commit bash-20140207 snapshot

This commit is contained in:
Chet Ramey
2014-02-20 10:25:06 -05:00
parent 387affeb74
commit 595e3e6925
44 changed files with 14631 additions and 1543 deletions
+2 -2
View File
@@ -790,8 +790,8 @@ j. New user-settable variable, show-mode-in-prompt, adds a characters to the
beginning of the prompt indicating the current editing mode.
k. New application-settable variable: rl_input_available_hook; function to be
called when readline detects there is data available on its input file
descriptor.
called when readline needs to check whether there is data available on its
input source. The default hook checks rl_instream.
l. Readline calls an application-set event hook (rl_signal_event_hook) after
it gets a signal while reading input (read returns -1/EINTR but readline
+2 -2
View File
@@ -791,8 +791,8 @@ j. New user-settable variable, show-mode-in-prompt, adds a characters to the
beginning of the prompt indicating the current editing mode.
k. New application-settable variable: rl_input_available_hook; function to be
called when readline detects there is data available on its input file
descriptor.
called when readline needs to check whether there is data available on its
input source. The default hook checks rl_instream.
l. Readline calls an application-set event hook (rl_signal_event_hook) after
it gets a signal while reading input (read returns -1/EINTR but readline
+41
View File
@@ -5779,3 +5779,44 @@ 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 <alexandru.damian@intel.com>
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 <jidanni@jidanni.org>
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
<ilyushkeane@gmail.com>
+5813
View File
File diff suppressed because it is too large Load Diff
+82
View File
@@ -0,0 +1,82 @@
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.2 standard by changing the behavior to match that
specified by Posix.2 in areas where the bash default differs.
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 >& redirection does not redirect stdout and stderr.
3. The message printed by the job control code and builtins when a job
exits with a non-zero status is `Done(status)'.
4. Reserved words may not be aliased.
5. The Posix.2 PS1 and PS2 expansions of `!' -> history number and
`!!' -> `!' are enabled, and parameter expansion is performed on
the value regardless of the setting of the `promptvars' option.
6. Interactive comments are enabled by default. (Note that bash has
them on by default anyway.)
7. The Posix.2 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 default history file is ~/.sh_history (default value of $HISTFILE).
10. The output of `kill -l' prints all the signal names on a single line,
separated by spaces.
11. Non-interactive shells exit if `file' in `. file' is not found.
12. Redirection operators do not perform pathname expansion on the word
in the redirection unless the shell is interactive
13. Function names must be valid shell identifiers. 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 illegal name
causes a fatal syntax error in non-interactive shells.
14. Posix.2 `special' builtins are found before shell functions during command
lookup.
15. If a Posix.2 special builtin returns an error status, a non-interactive
shell exits. The fatal errors are those listed in the POSIX.2 standard,
and include things like passing incorrect options, redirection errors,
variable assignment errors for assignments preceding the command name,
and so on.
16. The environment passed to executed commands is not sorted. Neither is
the output of `set'. This is not strictly Posix.2 behavior, but sh
does it this way. Ksh does not. It's not necessary to sort the
environment; no program should rely on it being sorted.
17. If the `cd' builtin finds a directory to change to using $CDPATH, the
value it assigns to $PWD does not contain any symbolic links, as if
`cd -P' had been executed.
18. 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 read-only variable.
19. 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 read-only variable.
20. Process substitution is not available.
21. Assignment statements preceding POSIX.2 `special' builtins persist in
the shell environment after the builtin completes.
There is other Posix.2 behavior that bash does not implement. Specifically:
1. Assignment statements affect the execution environment of all builtins,
not just special ones.
+544
View File
@@ -0,0 +1,544 @@
This file is set.def, from which is created set.c.
It implements the "set" and "unset" builtins in Bash.
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 1, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
$PRODUCES set.c
#include <stdio.h>
#include "../shell.h"
#include "../flags.h"
#include "bashgetopt.h"
extern int interactive;
extern int noclobber, posixly_correct;
#if defined (READLINE)
extern int rl_editing_mode, no_line_editing;
#endif /* READLINE */
$BUILTIN set
$FUNCTION set_builtin
$SHORT_DOC set [--abefhkmnptuvxldBCHP] [-o option] [arg ...]
-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 Locate and remember function commands as functions are
defined. Function commands are normally looked up when
the function is executed.
-i Force the shell to be an "interactive" one. Interactive shells
always read `~/.bashrc' on startup.
-k All keyword 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
histexpand same as -H
ignoreeof the shell will not exit upon reading EOF
interactive-comments
allow comments to appear in interactive commands
monitor same as -m
noclobber disallow redirection to existing files
noexec same as -n
noglob same as -f
nohash same as -d
notify save as -b
nounset same as -u
physical same as -P
posix change the behavior of bash where the default
operation differs from the 1003.2 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.
-l Save and restore the binding of the NAME in a FOR command.
-d Disable the hashing of commands that are looked up for execution.
Normally, commands are remembered in a hash table, and once
found, do not have to be looked up again.
#if defined (BRACE_EXPANSION)
-B the shell will perform brace expansion
#endif /* BRACE_EXPANSION */
#if defined (BANG_HISTORY)
-H Enable ! style history substitution. This flag is on
by default.
#endif /* BANG_HISTORY */
-C If set, disallow existing regular files to be overwritten
by redirection of output.
-P If set, do not follow symbolic links when executing commands
such as cd which change the current directory.
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.
$END
/* An a-list used to match long options for set -o to the corresponding
option letter. */
struct {
char *name;
int letter;
} o_options[] = {
{ "allexport", 'a' },
#if defined (BRACE_EXPANSION)
{ "braceexpand",'B' },
#endif
{ "errexit", 'e' },
{ "histexpand", 'H' },
{ "monitor", 'm' },
{ "noexec", 'n' },
{ "noglob", 'f' },
{ "nohash", 'd' },
#if defined (JOB_CONTROL)
{ "notify", 'b' },
#endif /* JOB_CONTROL */
{"nounset", 'u' },
{"physical", 'P' },
{"privileged", 'p' },
{"verbose", 'v' },
{"xtrace", 'x' },
{(char *)NULL, 0},
};
#define MINUS_O_FORMAT "%-15s\t%s\n"
void
list_minus_o_opts ()
{
register int i;
char *on = "on", *off = "off";
printf (MINUS_O_FORMAT, "noclobber", (noclobber == 1) ? on : off);
if (find_variable ("ignoreeof") || find_variable ("IGNOREEOF"))
printf (MINUS_O_FORMAT, "ignoreeof", on);
else
printf (MINUS_O_FORMAT, "ignoreeof", off);
printf (MINUS_O_FORMAT, "interactive-comments",
interactive_comments ? on : off);
printf (MINUS_O_FORMAT, "posix", posixly_correct ? on : off);
#if defined (READLINE)
if (no_line_editing)
{
printf (MINUS_O_FORMAT, "emacs", off);
printf (MINUS_O_FORMAT, "vi", off);
}
else
{
/* Magic. This code `knows' how readline handles rl_editing_mode. */
printf (MINUS_O_FORMAT, "emacs", (rl_editing_mode == 1) ? on : off);
printf (MINUS_O_FORMAT, "vi", (rl_editing_mode == 0) ? on : off);
}
#endif /* READLINE */
for (i = 0; o_options[i].name; i++)
{
int *on_or_off, zero = 0;
on_or_off = find_flag (o_options[i].letter);
if (on_or_off == FLAG_UNKNOWN)
on_or_off = &zero;
printf (MINUS_O_FORMAT, o_options[i].name, (*on_or_off == 1) ? on : off);
}
}
set_minus_o_option (on_or_off, option_name)
int on_or_off;
char *option_name;
{
int option_char = -1;
if (STREQ (option_name, "noclobber"))
{
if (on_or_off == FLAG_ON)
bind_variable ("noclobber", "");
else
unbind_variable ("noclobber");
stupidly_hack_special_variables ("noclobber");
}
else if (STREQ (option_name, "ignoreeof"))
{
unbind_variable ("ignoreeof");
unbind_variable ("IGNOREEOF");
if (on_or_off == FLAG_ON)
bind_variable ("IGNOREEOF", "10");
stupidly_hack_special_variables ("IGNOREEOF");
}
#if defined (READLINE)
else if ((STREQ (option_name, "emacs")) || (STREQ (option_name, "vi")))
{
if (on_or_off == FLAG_ON)
{
rl_variable_bind ("editing-mode", option_name);
if (interactive)
with_input_from_stdin ();
no_line_editing = 0;
}
else
{
int isemacs = (rl_editing_mode == 1);
if ((isemacs && STREQ (option_name, "emacs")) ||
(!isemacs && STREQ (option_name, "vi")))
{
if (interactive)
with_input_from_stream (stdin, "stdin");
no_line_editing = 1;
}
else
builtin_error ("not in %s editing mode", option_name);
}
}
#endif /* READLINE */
else if (STREQ (option_name, "interactive-comments"))
interactive_comments = (on_or_off == FLAG_ON);
else if (STREQ (option_name, "posix"))
{
posixly_correct = (on_or_off == FLAG_ON);
unbind_variable ("POSIXLY_CORRECT");
unbind_variable ("POSIX_PEDANTIC");
if (on_or_off == FLAG_ON)
{
bind_variable ("POSIXLY_CORRECT", "");
stupidly_hack_special_variables ("POSIXLY_CORRECT");
}
}
else
{
register int i;
for (i = 0; o_options[i].name; i++)
{
if (STREQ (option_name, o_options[i].name))
{
option_char = o_options[i].letter;
break;
}
}
if (option_char == -1)
{
builtin_error ("%s: unknown option name", option_name);
return (EXECUTION_FAILURE);
}
if (change_flag (option_char, on_or_off) == FLAG_ERROR)
{
bad_option (option_name);
return (EXECUTION_FAILURE);
}
}
return (EXECUTION_SUCCESS);
}
/* 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. */
set_builtin (list)
WORD_LIST *list;
{
int on_or_off, flag_name, force_assignment = 0;
if (!list)
{
SHELL_VAR **vars;
vars = all_shell_variables ();
if (vars)
{
print_var_list (vars);
free (vars);
}
vars = all_shell_functions ();
if (vars)
{
print_var_list (vars);
free (vars);
}
return (EXECUTION_SUCCESS);
}
/* Check validity of flag arguments. */
if (*list->word->word == '-' || *list->word->word == '+')
{
register char *arg;
WORD_LIST *save_list = list;
while (list && (arg = list->word->word))
{
char c;
if (arg[0] != '-' && arg[0] != '+')
break;
/* `-' or `--' signifies end of flag arguments. */
if (arg[0] == '-' &&
(!arg[1] || (arg[1] == '-' && !arg[2])))
break;
while (c = *++arg)
{
if (find_flag (c) == FLAG_UNKNOWN && c != 'o')
{
char s[2];
s[0] = c; s[1] = '\0';
bad_option (s);
if (c == '?')
builtin_usage ();
return (c == '?' ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
}
}
list = list->next;
}
list = save_list;
}
/* Do the set command. While the list consists of words starting with
'-' or '+' treat them as flags, otherwise, start assigning them to
$1 ... $n. */
while (list)
{
char *string = list->word->word;
/* If the argument is `--' or `-' then signal the end of the list
and remember the remaining arguments. */
if (string[0] == '-' && (!string[1] || (string[1] == '-' && !string[2])))
{
list = list->next;
/* `set --' unsets the positional parameters. */
if (string[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', '+');
}
break;
}
if ((on_or_off = *string) &&
(on_or_off == '-' || on_or_off == '+'))
{
int i = 1;
while (flag_name = string[i++])
{
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)
{
list_minus_o_opts ();
continue;
}
option_name = opt->word->word;
if (!option_name || !*option_name || (*option_name == '-'))
{
list_minus_o_opts ();
continue;
}
list = list->next; /* Skip over option name. */
if (set_minus_o_option (on_or_off, option_name) != EXECUTION_SUCCESS)
return (EXECUTION_FAILURE);
}
else
{
if (change_flag (flag_name, on_or_off) == FLAG_ERROR)
{
char opt[3];
opt[0] = on_or_off;
opt[1] = flag_name;
opt[2] = '\0';
bad_option (opt);
builtin_usage ();
return (EXECUTION_FAILURE);
}
}
}
}
else
{
break;
}
list = list->next;
}
/* Assigning $1 ... $n */
if (list || force_assignment)
remember_args (list, 1);
return (EXECUTION_SUCCESS);
}
$BUILTIN unset
$FUNCTION unset_builtin
$SHORT_DOC unset [-f] [-v] [name ...]
For each NAME, remove the corresponding variable or function. Given
the `-v', unset will only act on variables. Given the `-f' flag,
unset will only act on functions. With neither flag, unset first
tries to unset a variable, and if that fails, then tries to unset a
function. Some variables (such as PATH and IFS) cannot be unset; also
see readonly.
$END
#define NEXT_VARIABLE() any_failed++; list = list->next; continue;
unset_builtin (list)
WORD_LIST *list;
{
int unset_function, unset_variable, unset_array, opt, any_failed;
char *name;
unset_function = unset_variable = unset_array = any_failed = 0;
reset_internal_getopt ();
while ((opt = internal_getopt (list, "fv")) != -1)
{
switch (opt)
{
case 'f':
unset_function = 1;
break;
case 'v':
unset_variable = 1;
break;
default:
builtin_usage ();
return (EXECUTION_FAILURE);
}
}
list = loptend;
if (unset_function && unset_variable)
{
builtin_error ("cannot simultaneously unset a function and a variable");
return (EXECUTION_FAILURE);
}
while (list)
{
SHELL_VAR *var;
int tem;
#if defined (ARRAY_VARS)
char *t;
#endif
name = list->word->word;
#if defined (ARRAY_VARS)
if (!unset_function && valid_array_reference (name))
{
t = strchr (name, '[');
*t++ = '\0';
unset_array++;
}
#endif
var = unset_function ? find_function (name) : find_variable (name);
if (var && !unset_function && non_unsettable_p (var))
{
builtin_error ("%s: cannot unset", name);
NEXT_VARIABLE ();
}
/* Posix.2 says that unsetting readonly variables is an error. */
if (var && readonly_p (var))
{
builtin_error ("%s: cannot unset: readonly %s",
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)
{
builtin_error ("%s: not an array variable", name);
NEXT_VARIABLE ();
}
else
tem = unbind_array_element (var, t);
}
else
#endif /* ARRAY_VARS */
tem = makunbound (name, unset_function ? shell_functions : shell_variables);
/* This is what Posix.2 draft 11+ 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 && !unset_variable)
tem = makunbound (name, shell_functions);
if (tem == -1)
any_failed++;
else if (!unset_function)
stupidly_hack_special_variables (name);
list = list->next;
}
if (any_failed)
return (EXECUTION_FAILURE);
else
return (EXECUTION_SUCCESS);
}
+50
View File
@@ -0,0 +1,50 @@
/* unwind_prot.h - Macros and functions for hacking unwind protection. */
/* 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 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (_UNWIND_PROT_H)
#define _UNWIND_PROT_H
/* Run a function without interrupts. */
extern void begin_unwind_frame ();
extern void discard_unwind_frame ();
extern void run_unwind_frame ();
extern void add_unwind_protect ();
extern void remove_unwind_protect ();
extern void run_unwind_protects ();
extern void unwind_protect_var ();
/* Define for people who like their code to look a certain way. */
#define end_unwind_frame()
/* How to protect an integer. */
#define unwind_protect_int(X) unwind_protect_var (&(X), (char *)(X), sizeof (int))
/* How to protect a pointer to a string. */
#define unwind_protect_string(X) \
unwind_protect_var ((int *)&(X), (X), sizeof (char *))
/* How to protect any old pointer. */
#define unwind_protect_pointer(X) unwind_protect_string (X)
/* How to protect the contents of a jmp_buf. */
#define unwind_protect_jmp_buf(X) \
unwind_protect_var ((int *)(X), (char *)(X), sizeof (procenv_t))
#endif /* _UNWIND_PROT_H */
+1
View File
@@ -805,6 +805,7 @@ 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
+13 -2
View File
@@ -1720,6 +1720,7 @@ command_word_completion_function (hint_text, state)
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;
@@ -1799,7 +1800,7 @@ command_word_completion_function (hint_text, state)
if (filename_hint)
free (filename_hint);
filename_hint = savestring (hint);
fnhint = filename_hint = savestring (hint);
istate = 0;
@@ -2007,15 +2008,25 @@ globword:
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 (filename_hint, istate);
val = rl_filename_completion_function (fnhint, istate);
if (mapping_over == 4 && dircomplete_expand)
set_directory_hook ();
+4211
View File
File diff suppressed because it is too large Load Diff
+42
View File
@@ -0,0 +1,42 @@
# This file is a shell script that caches the results of configure
# tests for CYGWIN32 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 CYGWIN32, 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'}
# these may be necessary, but they are currently commented out
#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_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='no'}
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='missing'}
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/cygwin32.cache
+1745
View File
File diff suppressed because it is too large Load Diff
+12 -9
View File
@@ -468,7 +468,7 @@ SSHHEELLLL GGRRAAMMMMAARR
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
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
@@ -706,13 +706,16 @@ 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 occurs within double quotes, it expands to a sin-
gle word with the value of each parameter separated by the first
character of the IIFFSS special variable. That is, "$$**" is equiva-
lent 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 sepa-
rated by spaces. If IIFFSS is null, the parameters are joined
without intervening separators.
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"
@@ -5721,4 +5724,4 @@ BBUUGGSS
GNU Bash 4.3 2014 January 6 BASH(1)
GNU Bash 4.3 2014 February 2 BASH(1)
+3
View File
@@ -7526,6 +7526,9 @@ 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'',
+10 -6
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2014 January 6<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2014 February 2<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -1130,7 +1130,7 @@ 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 <I>list</I>.
<DT><B>if</B> <I>list</I>; <B>then</B> <I>list;</I> [ <B>elif</B> <I>list</I>; <B>then</B> <I>list</I>; ] ... [ <B>else</B> <I>list</I>; ] <B>fi</B><DD>
<DT><B>if</B> <I>list</I>; <B>then</B> <I>list</I>; [ <B>elif</B> <I>list</I>; <B>then</B> <I>list</I>; ] ... [ <B>else</B> <I>list</I>; ] <B>fi</B><DD>
The
<B>if </B>
@@ -1679,8 +1679,12 @@ only be referenced; assignment to them is not allowed.
<DT><B>*</B>
<DD>
Expands to the positional parameters, starting from one. When the
expansion occurs within double quotes, it expands to a single word
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
<FONT SIZE=-1><B>IFS</B>
@@ -13157,7 +13161,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 4.3<TH ALIGN=CENTER width=33%>2014 January 6<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 4.3<TH ALIGN=CENTER width=33%>2014 February 2<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -13263,6 +13267,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 23 January 2014 15:52:11 EST
Time: 04 February 2014 09:39:07 EST
</BODY>
</HTML>
BIN
View File
Binary file not shown.
+278 -269
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -81,9 +81,9 @@
@xrdef{Positional Parameters-pg}{19}
@xrdef{Special Parameters-title}{Special Parameters}
@xrdef{Special Parameters-snt}{Section@tie 3.4.2}
@xrdef{Special Parameters-pg}{20}
@xrdef{Shell Expansions-title}{Shell Expansions}
@xrdef{Shell Expansions-snt}{Section@tie 3.5}
@xrdef{Special Parameters-pg}{20}
@xrdef{Brace Expansion-title}{Brace Expansion}
@xrdef{Brace Expansion-snt}{Section@tie 3.5.1}
@xrdef{Shell Expansions-pg}{21}
@@ -99,18 +99,18 @@
@xrdef{Arithmetic Expansion-title}{Arithmetic Expansion}
@xrdef{Arithmetic Expansion-snt}{Section@tie 3.5.5}
@xrdef{Command Substitution-pg}{28}
@xrdef{Arithmetic Expansion-pg}{28}
@xrdef{Process Substitution-title}{Process Substitution}
@xrdef{Process Substitution-snt}{Section@tie 3.5.6}
@xrdef{Word Splitting-title}{Word Splitting}
@xrdef{Word Splitting-snt}{Section@tie 3.5.7}
@xrdef{Filename Expansion-title}{Filename Expansion}
@xrdef{Filename Expansion-snt}{Section@tie 3.5.8}
@xrdef{Arithmetic Expansion-pg}{29}
@xrdef{Process Substitution-pg}{29}
@xrdef{Word Splitting-pg}{29}
@xrdef{Filename Expansion-pg}{29}
@xrdef{Filename Expansion-title}{Filename Expansion}
@xrdef{Filename Expansion-snt}{Section@tie 3.5.8}
@xrdef{Pattern Matching-title}{Pattern Matching}
@xrdef{Pattern Matching-snt}{Section@tie 3.5.8.1}
@xrdef{Filename Expansion-pg}{30}
@xrdef{Pattern Matching-pg}{30}
@xrdef{Quote Removal-title}{Quote Removal}
@xrdef{Quote Removal-snt}{Section@tie 3.5.9}
+6 -6
View File
@@ -52,14 +52,14 @@
\entry{parameter expansion}{23}{parameter expansion}
\entry{expansion, parameter}{23}{expansion, parameter}
\entry{command substitution}{28}{command substitution}
\entry{expansion, arithmetic}{28}{expansion, arithmetic}
\entry{arithmetic expansion}{28}{arithmetic expansion}
\entry{expansion, arithmetic}{29}{expansion, arithmetic}
\entry{arithmetic expansion}{29}{arithmetic expansion}
\entry{process substitution}{29}{process substitution}
\entry{word splitting}{29}{word splitting}
\entry{expansion, filename}{29}{expansion, filename}
\entry{expansion, pathname}{29}{expansion, pathname}
\entry{filename expansion}{29}{filename expansion}
\entry{pathname expansion}{29}{pathname expansion}
\entry{expansion, filename}{30}{expansion, filename}
\entry{expansion, pathname}{30}{expansion, pathname}
\entry{filename expansion}{30}{filename expansion}
\entry{pathname expansion}{30}{pathname expansion}
\entry{pattern matching}{30}{pattern matching}
\entry{matching, pattern}{30}{matching, pattern}
\entry{redirection}{31}{redirection}
+6 -6
View File
@@ -1,7 +1,7 @@
\initial {A}
\entry {alias expansion}{88}
\entry {arithmetic evaluation}{87}
\entry {arithmetic expansion}{28}
\entry {arithmetic expansion}{29}
\entry {arithmetic, shell}{87}
\entry {arrays}{89}
\initial {B}
@@ -42,18 +42,18 @@
\entry {execution environment}{36}
\entry {exit status}{3, 38}
\entry {expansion}{21}
\entry {expansion, arithmetic}{28}
\entry {expansion, arithmetic}{29}
\entry {expansion, brace}{21}
\entry {expansion, filename}{29}
\entry {expansion, filename}{30}
\entry {expansion, parameter}{23}
\entry {expansion, pathname}{29}
\entry {expansion, pathname}{30}
\entry {expansion, tilde}{22}
\entry {expressions, arithmetic}{87}
\entry {expressions, conditional}{85}
\initial {F}
\entry {field}{3}
\entry {filename}{3}
\entry {filename expansion}{29}
\entry {filename expansion}{30}
\entry {foreground}{97}
\entry {functions, shell}{17}
\initial {H}
@@ -92,7 +92,7 @@
\entry {parameters}{18}
\entry {parameters, positional}{19}
\entry {parameters, special}{20}
\entry {pathname expansion}{29}
\entry {pathname expansion}{30}
\entry {pattern matching}{30}
\entry {pipeline}{8}
\entry {POSIX}{3}
BIN
View File
Binary file not shown.
+11 -7
View File
@@ -1,6 +1,6 @@
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 23 2014 by texi2html 1.64 -->
<!-- Created on February, 4 2014 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
@@ -33,11 +33,11 @@ Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
<H1>Bash Reference Manual</H1></P><P>
This text is a brief description of the features that are present in
the Bash shell (version 4.3, 6 January 2014).
the Bash shell (version 4.3, 2 February 2014).
The Bash home page is <A HREF="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</A>.
</P><P>
This is Edition 4.3, last updated 6 January 2014,
This is Edition 4.3, last updated 2 February 2014,
of <CITE>The GNU Bash Reference Manual</CITE>,
for <CODE>Bash</CODE>, Version 4.3.
</P><P>
@@ -2042,8 +2042,12 @@ only be referenced; assignment to them is not allowed.
<DT><CODE>*</CODE>
<DD><A NAME="IDX47"></A>
<A NAME="IDX48"></A>
($*) Expands to the positional parameters, starting from one. When the
expansion occurs within double quotes, it expands to a single word
($*) 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 <CODE>IFS</CODE>
special variable. That is, <CODE>"$*"</CODE> is equivalent
@@ -17300,7 +17304,7 @@ to permit their use in free software.
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>About this document</H1>
This document was generated by <I>Chet Ramey</I> on <I>January, 23 2014</I>
This document was generated by <I>Chet Ramey</I> on <I>February, 4 2014</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
@@ -17462,7 +17466,7 @@ the following structure:
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Chet Ramey</I> on <I>January, 23 2014</I>
by <I>Chet Ramey</I> on <I>February, 4 2014</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
+159 -156
View File
@@ -2,9 +2,9 @@ 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, 6 January 2014).
the Bash shell (version 4.3, 2 February 2014).
This is Edition 4.3, last updated 6 January 2014, of `The GNU Bash
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.
@@ -28,10 +28,10 @@ Bash Features
*************
This text is a brief description of the features that are present in
the Bash shell (version 4.3, 6 January 2014). The Bash home page is
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 6 January 2014, of `The GNU 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
@@ -1351,13 +1351,16 @@ only be referenced; assignment to them is not allowed.
`*'
($*) Expands to the positional parameters, starting from one.
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.
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.
@@ -10688,24 +10691,24 @@ D.3 Parameter and Variable Index
[index]
* Menu:
* !: Special Parameters. (line 47)
* #: Special Parameters. (line 30)
* $: Special Parameters. (line 42)
* $!: Special Parameters. (line 48)
* $#: Special Parameters. (line 31)
* $$: Special Parameters. (line 43)
* !: 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 38)
* $0: Special Parameters. (line 53)
* $?: Special Parameters. (line 34)
* $@: Special Parameters. (line 20)
* $_: Special Parameters. (line 62)
* $-: 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 37)
* 0: Special Parameters. (line 52)
* ?: Special Parameters. (line 33)
* @: Special Parameters. (line 19)
* _: Special Parameters. (line 61)
* -: 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)
@@ -11156,134 +11159,134 @@ D.5 Concept Index

Tag Table:
Node: Top928
Node: Introduction2844
Node: What is Bash?3072
Node: What is a shell?4185
Node: Definitions6724
Node: Basic Shell Features9642
Node: Shell Syntax10861
Node: Shell Operation11891
Node: Quoting13185
Node: Escape Character14488
Node: Single Quotes14973
Node: Double Quotes15321
Node: ANSI-C Quoting16446
Node: Locale Translation17690
Node: Comments18586
Node: Shell Commands19204
Node: Simple Commands20076
Node: Pipelines20707
Node: Lists23445
Node: Compound Commands25174
Node: Looping Constructs26180
Node: Conditional Constructs28643
Node: Command Grouping39573
Node: Coprocesses41052
Node: GNU Parallel42885
Node: Shell Functions46871
Node: Shell Parameters51955
Node: Positional Parameters56084
Node: Special Parameters56984
Node: Shell Expansions60095
Node: Brace Expansion62038
Node: Tilde Expansion64819
Node: Shell Parameter Expansion67168
Node: Command Substitution79462
Node: Arithmetic Expansion80795
Node: Process Substitution81727
Node: Word Splitting82777
Node: Filename Expansion84425
Node: Pattern Matching86590
Node: Quote Removal90290
Node: Redirections90585
Node: Executing Commands99749
Node: Simple Command Expansion100419
Node: Command Search and Execution102349
Node: Command Execution Environment104686
Node: Environment107672
Node: Exit Status109331
Node: Signals110953
Node: Shell Scripts112921
Node: Shell Builtin Commands115439
Node: Bourne Shell Builtins117467
Node: Bash Builtins137374
Node: Modifying Shell Behavior164827
Node: The Set Builtin165172
Node: The Shopt Builtin175498
Node: Special Builtins189919
Node: Shell Variables190898
Node: Bourne Shell Variables191338
Node: Bash Variables193369
Node: Bash Features220244
Node: Invoking Bash221143
Node: Bash Startup Files226921
Node: Interactive Shells231950
Node: What is an Interactive Shell?232360
Node: Is this Shell Interactive?233009
Node: Interactive Shell Behavior233824
Node: Bash Conditional Expressions237112
Node: Shell Arithmetic241114
Node: Aliases243890
Node: Arrays246446
Node: The Directory Stack251427
Node: Directory Stack Builtins252146
Node: Controlling the Prompt255102
Node: The Restricted Shell257874
Node: Bash POSIX Mode259711
Node: Job Control269098
Node: Job Control Basics269558
Node: Job Control Builtins274277
Node: Job Control Variables278748
Node: Command Line Editing279906
Node: Introduction and Notation281578
Node: Readline Interaction283200
Node: Readline Bare Essentials284391
Node: Readline Movement Commands286180
Node: Readline Killing Commands287145
Node: Readline Arguments289065
Node: Searching290109
Node: Readline Init File292295
Node: Readline Init File Syntax293442
Node: Conditional Init Constructs310279
Node: Sample Init File312812
Node: Bindable Readline Commands315930
Node: Commands For Moving317137
Node: Commands For History318281
Node: Commands For Text322466
Node: Commands For Killing325395
Node: Numeric Arguments327852
Node: Commands For Completion328991
Node: Keyboard Macros333183
Node: Miscellaneous Commands333871
Node: Readline vi Mode339677
Node: Programmable Completion340584
Node: Programmable Completion Builtins347860
Node: A Programmable Completion Example357606
Node: Using History Interactively362856
Node: Bash History Facilities363540
Node: Bash History Builtins366539
Node: History Interaction370467
Node: Event Designators373172
Node: Word Designators374394
Node: Modifiers376033
Node: Installing Bash377437
Node: Basic Installation378574
Node: Compilers and Options381266
Node: Compiling For Multiple Architectures382007
Node: Installation Names383671
Node: Specifying the System Type384489
Node: Sharing Defaults385205
Node: Operation Controls385878
Node: Optional Features386836
Node: Reporting Bugs396900
Node: Major Differences From The Bourne Shell398098
Node: GNU Free Documentation License414957
Node: Indexes440153
Node: Builtin Index440607
Node: Reserved Word Index447434
Node: Variable Index449882
Node: Function Index464062
Node: Concept Index471363
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 Behavior165059
Node: The Set Builtin165404
Node: The Shopt Builtin175730
Node: Special Builtins190151
Node: Shell Variables191130
Node: Bourne Shell Variables191570
Node: Bash Variables193601
Node: Bash Features220476
Node: Invoking Bash221375
Node: Bash Startup Files227153
Node: Interactive Shells232182
Node: What is an Interactive Shell?232592
Node: Is this Shell Interactive?233241
Node: Interactive Shell Behavior234056
Node: Bash Conditional Expressions237344
Node: Shell Arithmetic241346
Node: Aliases244122
Node: Arrays246678
Node: The Directory Stack251659
Node: Directory Stack Builtins252378
Node: Controlling the Prompt255334
Node: The Restricted Shell258106
Node: Bash POSIX Mode259943
Node: Job Control269330
Node: Job Control Basics269790
Node: Job Control Builtins274509
Node: Job Control Variables278980
Node: Command Line Editing280138
Node: Introduction and Notation281810
Node: Readline Interaction283432
Node: Readline Bare Essentials284623
Node: Readline Movement Commands286412
Node: Readline Killing Commands287377
Node: Readline Arguments289297
Node: Searching290341
Node: Readline Init File292527
Node: Readline Init File Syntax293674
Node: Conditional Init Constructs310511
Node: Sample Init File313044
Node: Bindable Readline Commands316162
Node: Commands For Moving317369
Node: Commands For History318513
Node: Commands For Text322698
Node: Commands For Killing325627
Node: Numeric Arguments328084
Node: Commands For Completion329223
Node: Keyboard Macros333415
Node: Miscellaneous Commands334103
Node: Readline vi Mode339909
Node: Programmable Completion340816
Node: Programmable Completion Builtins348092
Node: A Programmable Completion Example357838
Node: Using History Interactively363088
Node: Bash History Facilities363772
Node: Bash History Builtins366771
Node: History Interaction370699
Node: Event Designators373404
Node: Word Designators374626
Node: Modifiers376265
Node: Installing Bash377669
Node: Basic Installation378806
Node: Compilers and Options381498
Node: Compiling For Multiple Architectures382239
Node: Installation Names383903
Node: Specifying the System Type384721
Node: Sharing Defaults385437
Node: Operation Controls386110
Node: Optional Features387068
Node: Reporting Bugs397132
Node: Major Differences From The Bourne Shell398330
Node: GNU Free Documentation License415189
Node: Indexes440385
Node: Builtin Index440839
Node: Reserved Word Index447666
Node: Variable Index450114
Node: Function Index464294
Node: Concept Index471595

End Tag Table
+7 -7
View File
@@ -1,4 +1,4 @@
This is TeX, Version 3.1415926 (TeX Live 2011/Fink) (format=tex 2012.4.18) 9 JAN 2014 16:24
This is TeX, Version 3.1415926 (TeX Live 2011/Fink) (format=tex 2012.4.18) 4 FEB 2014 09:39
**/usr/homes/chet/src/bash/src/doc/bashref.texi
(/usr/homes/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
Loading texinfo [version 2013-09-11.11]:
@@ -238,11 +238,11 @@ arallel -k traceroute[]
.etc.
[16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30]
[31] [32] [33] [34] [35] [36] [37] [38] Chapter 4 [39] [40] [41] [42] [43]
[31] [32] [33] [34] [35] [36] [37] [38] [39] Chapter 4 [40] [41] [42] [43]
[44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58]
[59] [60] [61] [62] [63] [64] [65] [66] [67] Chapter 5 [68] [69] [70] [71]
[72] [73] [74] [75] [76] [77] [78] Chapter 6 [79]
Overfull \hbox (49.43388pt too wide) in paragraph at lines 5996--5996
Overfull \hbox (49.43388pt too wide) in paragraph at lines 5999--5999
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -255,7 +255,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
Overfull \hbox (72.42863pt too wide) in paragraph at lines 5997--5997
Overfull \hbox (72.42863pt too wide) in paragraph at lines 6000--6000
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
-
@@ -269,7 +269,7 @@ Overfull \hbox (72.42863pt too wide) in paragraph at lines 5997--5997
.etc.
Overfull \hbox (32.18782pt too wide) in paragraph at lines 5998--5998
Overfull \hbox (32.18782pt too wide) in paragraph at lines 6001--6001
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -379,10 +379,10 @@ Overfull \vbox (10.81442pt too high) has occurred while \output is active
Here is how much of TeX's memory you used:
2225 strings out of 497974
30407 string characters out of 3220833
68772 words of memory out of 3000000
68774 words of memory out of 3000000
3040 multiletter control sequences out of 15000+200000
32896 words of font info for 113 fonts, out of 3000000 for 9000
51 hyphenation exceptions out of 8191
16i,6n,14p,319b,749s stack positions out of 5000i,500n,10000p,200000b,50000s
Output written on bashref.dvi (172 pages, 721324 bytes).
Output written on bashref.dvi (172 pages, 721588 bytes).
BIN
View File
Binary file not shown.
+1057 -1056
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -4003,6 +4003,10 @@ 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,
+3 -3
View File
@@ -31,10 +31,10 @@
@numsubsecentry{Tilde Expansion}{3.5.2}{Tilde Expansion}{22}
@numsubsecentry{Shell Parameter Expansion}{3.5.3}{Shell Parameter Expansion}{23}
@numsubsecentry{Command Substitution}{3.5.4}{Command Substitution}{28}
@numsubsecentry{Arithmetic Expansion}{3.5.5}{Arithmetic Expansion}{28}
@numsubsecentry{Arithmetic Expansion}{3.5.5}{Arithmetic Expansion}{29}
@numsubsecentry{Process Substitution}{3.5.6}{Process Substitution}{29}
@numsubsecentry{Word Splitting}{3.5.7}{Word Splitting}{29}
@numsubsecentry{Filename Expansion}{3.5.8}{Filename Expansion}{29}
@numsubsecentry{Filename Expansion}{3.5.8}{Filename Expansion}{30}
@numsubsubsecentry{Pattern Matching}{3.5.8.1}{Pattern Matching}{30}
@numsubsecentry{Quote Removal}{3.5.9}{Quote Removal}{31}
@numsecentry{Redirections}{3.6}{Redirections}{31}
@@ -42,7 +42,7 @@
@numsubsecentry{Redirecting Output}{3.6.2}{}{33}
@numsubsecentry{Appending Redirected Output}{3.6.3}{}{33}
@numsubsecentry{Redirecting Standard Output and Standard Error}{3.6.4}{}{33}
@numsubsecentry{Appending Standard Output and Standard Error}{3.6.5}{}{33}
@numsubsecentry{Appending Standard Output and Standard Error}{3.6.5}{}{34}
@numsubsecentry{Here Documents}{3.6.6}{}{34}
@numsubsecentry{Here Strings}{3.6.7}{}{34}
@numsubsecentry{Duplicating File Descriptors}{3.6.8}{}{34}
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Thu Jan 23 15:52:06 2014
%%CreationDate: Tue Feb 4 09:39:00 2014
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Thu Jan 23 15:52:06 2014
%%CreationDate: Tue Feb 4 09:39:00 2014
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.19 2
+238
View File
@@ -0,0 +1,238 @@
#
# Simple makefile for the sample loadable builtins
#
# Copyright (C) 1996 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., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
# Include some boilerplate Gnu makefile definitions.
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
infodir = @infodir@
includedir = @includedir@
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@
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 cut realpath getconf strftime
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)
getconf: getconf.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ getconf.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)
cut: cut.o
$(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ cut.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)
# 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
getconf.o: getconf.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
+2
View File
@@ -110,6 +110,8 @@ getc_with_restart (stream)
local_index = local_bufused = 0;
return EOF;
}
else if (interrupt_state || terminating_signal) /* QUIT; */
local_index = local_bufused = 0;
}
local_index = 0;
}
+76
View File
@@ -0,0 +1,76 @@
# This makefile for Readline library documentation is in -*- text -*- mode.
# Emacs likes it that way.
RM = rm -f
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
TEXI2HTML = texi2html
QUIETPS = #set this to -q to shut up dvips
DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky
INSTALL_DATA = cp
infodir = /usr/local/info
RLSRC = rlman.texinfo rluser.texinfo rltech.texinfo
HISTSRC = hist.texinfo hsuser.texinfo hstech.texinfo
DVIOBJ = readline.dvi history.dvi
INFOOBJ = readline.info history.info
PSOBJ = readline.ps history.ps
HTMLOBJ = readline.html history.html
all: info dvi html ps
nodvi: info html
readline.dvi: $(RLSRC)
$(TEXI2DVI) rlman.texinfo
mv rlman.dvi readline.dvi
readline.info: $(RLSRC)
$(MAKEINFO) --no-split -o $@ rlman.texinfo
history.dvi: ${HISTSRC}
$(TEXI2DVI) hist.texinfo
mv hist.dvi history.dvi
history.info: ${HISTSRC}
$(MAKEINFO) --no-split -o $@ hist.texinfo
readline.ps: readline.dvi
$(RM) $@
$(DVIPS) readline.dvi
history.ps: history.dvi
$(RM) $@
$(DVIPS) history.dvi
readline.html: ${RLSRC}
$(TEXI2HTML) rlman.texinfo
sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman.html > readline.html
sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman_toc.html > readline_toc.html
$(RM) rlman.html rlman_toc.html
history.html: ${HISTSRC}
$(TEXI2HTML) hist.texinfo
sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist.html > history.html
sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist_toc.html > history_toc.html
$(RM) hist.html hist_toc.html
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
mostlyclean: clean
maintainer-clean: clean
$(RM) *.dvi *.info *.info-* *.ps *.html
install: info
${INSTALL_DATA} readline.info $(infodir)/readline.info
${INSTALL_DATA} history.info $(infodir)/history.info
+12 -2
View File
@@ -440,6 +440,8 @@ 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
@@ -451,14 +453,22 @@ call is interrupted when Readline is reading terminal input.
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 functions using Readline's callback interface
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.
@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
+2
View File
@@ -586,6 +586,8 @@ 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
+5 -2
View File
@@ -278,8 +278,11 @@ ansic_quote (str, flags, rlen)
if (clen == 1)
*r++ = c;
else
for (b = 0; b < (int)clen; c = b ? *++s : c)
*r++ = c;
{
for (b = 0; b < (int)clen; b++)
*r++ = (unsigned char)s[b];
s += clen - 1; /* -1 because of the increment above */
}
}
*r++ = '\'';
+70
View File
@@ -0,0 +1,70 @@
#! /bin/bash
DATE=$(date +%Y%m%d)
PARENT=/fs2/chet/bash
FROOT=bash-$DATE
DIR=$PARENT/$FROOT
TARF=${FROOT}.tar
SRC=/usr/homes/chet/src/bash/src
fflag= sflag= dflag=
while getopts "dfsp:" opt
do
case $opt in
d) dflag=1 ;;
f) fflag=1 ;;
p) PARENT=$OPTARG
if [ ! -d "$PARENT" ]; then
echo "mk-takehome: $PARENT: directory does not exist" 2>&1
exit 2
fi ;;
s) sflag=1 ;;
*) echo "mk-takehome: usage: mk-takehome [-dfs]" 2>&1
exit 2;;
esac
done
shift $(($OPTIND - 1))
if [ -n "$fflag" ]; then
rm -rf "$DIR"
fi
mkdir $DIR || exit 1
cd $DIR || exit 1
cd $SRC || exit 1
tar cf - . | (cd $DIR ; tar xvpf - )
cd $DIR || exit 1
find . -type f -name '*~' -print | xargs rm -f
find . -type d -name 'savedir' -print | xargs rm -rf
rm parser-built y.tab.c y.tab.h
# bison -y -d parse.y # make sure y.tab.h present for dependencies
rm -f d d? ddd ddd? # convention for temp diff files
cd $PARENT || exit 1
tar cvf ${TARF} $FROOT
gzip -v ${TARF}
REMHOST=z4
if [ -n "$sflag" ]; then
scp ${TARF}.gz ${REMHOST}:
fi
if [ -n "$dflag" ]; then
if [ ! -d $HOME/Dropbox ]; then
HOME=~chet
fi
cp ${TARF}.gz $HOME/Dropbox/
fi
+21
View File
@@ -622,6 +622,27 @@ unary_test (op, arg)
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':
+8
View File
@@ -380,3 +380,11 @@ strlen(4four) = 5
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
+2
View File
@@ -398,3 +398,5 @@ ${THIS_SH} ./array13.sub
${THIS_SH} ./array14.sub
${THIS_SH} ./array15.sub
${THIS_SH} ./array16.sub
+21
View File
@@ -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
+50
View File
@@ -0,0 +1,50 @@
:; ./shx
sh:
<&$fd ok
nlbq Mon Aug 3 02:45:00 EDT 1992
bang geoff
quote 712824302
setbq defmsgid=<1992Aug3.024502.6176@host>
bgwait sleep done... wait 6187
bash:
<&$fd ok
nlbq Mon Aug 3 02:45:09 EDT 1992
bang geoff
quote 712824311
setbq defmsgid=<1992Aug3.024512.6212@host>
bgwait sleep done... wait 6223
ash:
<&$fd shx1: 4: Syntax error: Bad fd number
nlbq Mon Aug 3 02:45:19 EDT 1992
bang geoff
quote getdate: `"now"' not a valid date
setbq defmsgid=<1992Aug3.` echo 024521
bgwait sleep done... wait 6241
ksh:
<&$fd ok
nlbq ./shx: 6248 Memory fault - core dumped
bang geoff
quote getdate: `"now"' not a valid date
setbq defmsgid=<1992Aug3.024530.6257@host>
bgwait no such job: 6265
wait 6265
sleep done...
zsh:
<&$fd ok
nlbq Mon Aug 3 02:45:36 EDT 1992
bang shx3: event not found: /s/ [4]
quote 712824337
setbq defmsgid=<..6290@host>
bgwait shx7: unmatched " [9]
sleep done...
:;
+10
View File
@@ -0,0 +1,10 @@
#! /bin/sh
for cmd in sh bash ash ksh zsh
do
echo
echo $cmd:
for demo in shx?
do
$cmd $demo
done
done
+5 -1
View File
@@ -755,7 +755,11 @@ restore_default_signal (sig)
return;
/* If we aren't trapping this signal, don't bother doing anything else. */
if ((sigmodes[sig] & SIG_TRAPPED) == 0)
/* 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. */