mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-23 22:07:58 +02:00
commit bash-20071011 snapshot
This commit is contained in:
@@ -14914,3 +14914,52 @@ pathexp.c
|
||||
code will interpret backslashes as quoting characters internally.
|
||||
Bug reported by <herbert@gondor.apana.org.au> on the debian list
|
||||
(443685)
|
||||
|
||||
10/8
|
||||
----
|
||||
lib/readline/display.c
|
||||
- in update_line, make sure _rl_last_c_pos is > 0 before setting
|
||||
cpos_adjusted (or we actually moved the cursor to column 0 in
|
||||
_rl_move_cursor_relative). Fixes redisplay bug with prompt with
|
||||
only invisible characters reported by dAniel hAhler
|
||||
<ubuntu@thequod.de>
|
||||
|
||||
10/10
|
||||
-----
|
||||
lib/readline/display.c
|
||||
- in rl_redisplay, when calculating the new physical cursor position
|
||||
in a multibyte locale (`tx'), do not call rl_backspace if tx ends
|
||||
up < 0. Rest of fix for bug reported by dAniel hAhler
|
||||
<ubuntu@thequod.de>
|
||||
|
||||
10/12
|
||||
-----
|
||||
lib/sh/getcwd.c
|
||||
- fix memory overwrite problem that's possible if buf is NULL and
|
||||
passed size is greater than the pathname length. Reported by
|
||||
Ian Campbell <ian.campbell@xensource.com>
|
||||
|
||||
builtins/ulimit.def
|
||||
- change the multiplier for the -c and -f options (`blocks') to 512,
|
||||
the traditional value (and the one POSIX specifies). Bug reported
|
||||
by Pete Graner <pgraner@redhat.com>
|
||||
|
||||
braces.c
|
||||
- pass process substitution through unchanged the same as command
|
||||
substitution. Prompted by suggestion from Stephane Chazelas
|
||||
<stephane_chazelas@yahoo.fr>
|
||||
|
||||
lib/readline/input.c
|
||||
- in rl_unget_char, fix off-by-one error when resetting pop_index if
|
||||
it's < 0. Bug reported by Uwe Doering <gemini@geminix.org>
|
||||
|
||||
builtins/type.def
|
||||
- change exit status of `type' to not successful if any of the
|
||||
requested commands are not found. Reported by Stephane Chazleas
|
||||
<stephane_chazelas@yahoo.fr>
|
||||
|
||||
pcomplete.c
|
||||
- change command_line_to_word_list to use rl_completer_word_break_characters
|
||||
instead of the shell metacharacters to split words, so programmable
|
||||
completion does the same thing readline does internally. Reported
|
||||
by Vasily Tarasov <vtaras@sw.ru>
|
||||
|
||||
@@ -14888,3 +14888,72 @@ config-top.h
|
||||
- new builder-modifiable define: DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS
|
||||
Turning it on will cause errors from EPIPE to not be reported by
|
||||
the normal shell write error message mechanism
|
||||
|
||||
builtins/common.c
|
||||
- if DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS is defined, don't print an
|
||||
error message from sh_wrerror if errno == EPIPE. Suggestion from
|
||||
Petr Sumbera <petr.sumbera@sun.com>
|
||||
|
||||
9/19
|
||||
----
|
||||
{jobs,nojobs}.c,jobs.h
|
||||
- add code to retry fork() after EAGAIN, with a progressively longer
|
||||
sleep between attempts, up to FORKSLEEP_MAX (16) seconds. Suggested
|
||||
by Martin Koeppe <mkoeppe@gmx.de>
|
||||
|
||||
9/21
|
||||
----
|
||||
version.c
|
||||
- change copyright year to 2007
|
||||
|
||||
9/25
|
||||
----
|
||||
pathexp.c
|
||||
- change quote_string_for_globbing to add a backslash in front of a
|
||||
backslash appearing in the pathname string, since the globbing
|
||||
code will interpret backslashes as quoting characters internally.
|
||||
Bug reported by <herbert@gondor.apana.org.au> on the debian list
|
||||
(443685)
|
||||
|
||||
10/8
|
||||
----
|
||||
lib/readline/display.c
|
||||
- in update_line, make sure _rl_last_c_pos is > 0 before setting
|
||||
cpos_adjusted (or we actually moved the cursor to column 0 in
|
||||
_rl_move_cursor_relative). Fixes redisplay bug with prompt with
|
||||
only invisible characters reported by dAniel hAhler
|
||||
<ubuntu@thequod.de>
|
||||
|
||||
10/10
|
||||
-----
|
||||
lib/readline/display.c
|
||||
- in rl_redisplay, when calculating the new physical cursor position
|
||||
in a multibyte locale (`tx'), do not call rl_backspace if tx ends
|
||||
up < 0. Rest of fix for bug reported by dAniel hAhler
|
||||
<ubuntu@thequod.de>
|
||||
|
||||
10/12
|
||||
-----
|
||||
lib/sh/getcwd.c
|
||||
- fix memory overwrite problem that's possible if buf is NULL and
|
||||
passed size is greater than the pathname length. Reported by
|
||||
Ian Campbell <ian.campbell@xensource.com>
|
||||
|
||||
builtins/ulimit.def
|
||||
- change the multiplier for the -c and -f options (`blocks') to 512,
|
||||
the traditional value (and the one POSIX specifies). Bug reported
|
||||
by Pete Graner <pgraner@redhat.com>
|
||||
|
||||
braces.c
|
||||
- pass process substitution through unchanged the same as command
|
||||
substitution. Prompted by suggestion from Stephane Chazelas
|
||||
<stephane_chazelas@yahoo.fr>
|
||||
|
||||
lib/readline/input.c
|
||||
- in rl_unget_char, fix off-by-one error when resetting pop_index if
|
||||
it's < 0. Bug reported by Uwe Doering <gemini@geminix.org>
|
||||
|
||||
builtins/type.def
|
||||
- change exit status of `type' to not successful if any of the
|
||||
requested commands are not found. Reported by Stephane Chazleas
|
||||
<stephane_chazelas@yahoo.fr>
|
||||
|
||||
@@ -67,7 +67,7 @@ HASH_TABLE *aliases = (HASH_TABLE *)NULL;
|
||||
void
|
||||
initialize_aliases ()
|
||||
{
|
||||
if (!aliases)
|
||||
if (aliases == 0)
|
||||
aliases = hash_create (ALIAS_HASH_BUCKETS);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,574 @@
|
||||
/* 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-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 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, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined (ALIAS)
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
# ifdef _MINIX
|
||||
# include <sys/types.h>
|
||||
# endif
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#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)
|
||||
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)
|
||||
{
|
||||
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 */
|
||||
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 (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 */
|
||||
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 (xstrchr (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 */
|
||||
@@ -486,8 +486,8 @@ brace_gobbler (text, tlen, indx, satisfy)
|
||||
}
|
||||
|
||||
#if defined (SHELL)
|
||||
/* Pass new-style command substitutions through unchanged. */
|
||||
if (c == '$' && text[i+1] == '(') /* ) */
|
||||
/* Pass new-style command and process substitutions through unchanged. */
|
||||
if ((c == '$' || c == '<' || c == '>') && text[i+1] == '(') /* ) */
|
||||
{
|
||||
si = i + 2;
|
||||
t = extract_command_subst (text, &si);
|
||||
|
||||
+4
-4
@@ -108,14 +108,14 @@ int
|
||||
type_builtin (list)
|
||||
WORD_LIST *list;
|
||||
{
|
||||
int dflags, successful_finds, opt;
|
||||
int dflags, any_failed, opt;
|
||||
WORD_LIST *this;
|
||||
|
||||
if (list == 0)
|
||||
return (EXECUTION_SUCCESS);
|
||||
|
||||
dflags = CDESC_SHORTDESC; /* default */
|
||||
successful_finds = 0;
|
||||
any_failed = 0;
|
||||
|
||||
/* Handle the obsolescent `-type', `-path', and `-all' by prescanning
|
||||
the arguments and converting those options to the form that
|
||||
@@ -181,11 +181,11 @@ type_builtin (list)
|
||||
if (!found && (dflags & (CDESC_PATH_ONLY|CDESC_TYPE)) == 0)
|
||||
sh_notfound (list->word->word);
|
||||
|
||||
successful_finds += found;
|
||||
any_failed += found == 0;
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
opt = (successful_finds != 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE;
|
||||
opt = (any_failed == 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE;
|
||||
return (sh_chkwrite (opt));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -272,7 +272,7 @@ describe_command (command, dflags)
|
||||
|
||||
/* We're blowing away THE_PRINTED_COMMAND here... */
|
||||
|
||||
result = named_function_string (command, function_cell (func), FUNC_MULTILINE);
|
||||
result = named_function_string (command, function_cell (func), FUNC_MULTILINE|FUNC_EXTERNAL);
|
||||
printf ("%s\n", result);
|
||||
}
|
||||
else if (dflags & CDESC_REUSABLE)
|
||||
|
||||
+3
-2
@@ -199,15 +199,16 @@ typedef struct {
|
||||
|
||||
static RESOURCE_LIMITS limits[] = {
|
||||
#ifdef RLIMIT_CORE
|
||||
{ 'c', RLIMIT_CORE, 1024, "core file size", "blocks" },
|
||||
{ 'c', RLIMIT_CORE, 512, "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, 1024, "file size", "blocks" },
|
||||
{ 'f', RLIMIT_FILESIZE, 512, "file size", "blocks" },
|
||||
#ifdef RLIMIT_SIGPENDING
|
||||
{ 'i', RLIMIT_SIGPENDING, 1, "pending signals", (char *)NULL },
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
This file is ulimit.def, from which is created ulimit.c.
|
||||
It implements the builtin "ulimit" in Bash.
|
||||
|
||||
Copyright (C) 1987-2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -193,8 +193,8 @@ 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. */
|
||||
char *description; /* Descriptive string to output. */
|
||||
char *units; /* scale */
|
||||
const char * const description; /* Descriptive string to output. */
|
||||
const char * const units; /* scale */
|
||||
} RESOURCE_LIMITS;
|
||||
|
||||
static RESOURCE_LIMITS limits[] = {
|
||||
@@ -356,7 +356,7 @@ ulimit_builtin (list)
|
||||
}
|
||||
#endif
|
||||
print_all_limits (mode == 0 ? LIMIT_SOFT : mode);
|
||||
return (EXECUTION_SUCCESS);
|
||||
return (sh_chkwrite (EXECUTION_SUCCESS));
|
||||
}
|
||||
|
||||
/* default is `ulimit -f' */
|
||||
@@ -687,7 +687,9 @@ printone (limind, curlim, pdesc)
|
||||
int pdesc;
|
||||
{
|
||||
char unitstr[64];
|
||||
int factor;
|
||||
|
||||
factor = limits[limind].block_factor;
|
||||
if (pdesc)
|
||||
{
|
||||
if (limits[limind].units)
|
||||
@@ -704,7 +706,7 @@ printone (limind, curlim, pdesc)
|
||||
else if (curlim == RLIM_SAVED_CUR)
|
||||
puts ("soft");
|
||||
else
|
||||
print_rlimtype ((curlim / limits[limind].block_factor), 1);
|
||||
print_rlimtype ((curlim / factor), 1);
|
||||
}
|
||||
|
||||
/* Set all limits to NEWLIM. NEWLIM currently must be RLIM_INFINITY, which
|
||||
|
||||
+1973
-1969
File diff suppressed because it is too large
Load Diff
+10
-8
@@ -944,19 +944,19 @@ 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
|
||||
.BR $ ,
|
||||
.BR ` ,
|
||||
.BR \` ,
|
||||
.BR \e ,
|
||||
and, when history expansion is enabled,
|
||||
.BR ! .
|
||||
The characters
|
||||
.B $
|
||||
and
|
||||
.B `
|
||||
.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 ` ,
|
||||
.BR \` ,
|
||||
\^\fB"\fP\^,
|
||||
.BR \e ,
|
||||
or
|
||||
@@ -1292,7 +1292,9 @@ The command argument to the \fB\-c\fP invocation option.
|
||||
An array variable whose members are the line numbers in source files
|
||||
corresponding to each member of \fBFUNCNAME\fP.
|
||||
\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source
|
||||
file where \fB${FUNCNAME[\fP\fI$ifP\fB]}\fP was called.
|
||||
file 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).
|
||||
The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fB.
|
||||
Use \fBLINENO\fP to obtain the current line number.
|
||||
.TP
|
||||
@@ -2607,7 +2609,7 @@ the command name. There are two forms:
|
||||
.RE
|
||||
or
|
||||
.RS
|
||||
\fB`\fP\fIcommand\fP\fB`\fP
|
||||
\fB\`\fP\fIcommand\fP\fB\`\fP
|
||||
.RE
|
||||
.PP
|
||||
.B Bash
|
||||
@@ -2622,7 +2624,7 @@ the equivalent but faster \fB$(< \fIfile\fP)\fR.
|
||||
When the old-style backquote form of substitution is used,
|
||||
backslash retains its literal meaning except when followed by
|
||||
.BR $ ,
|
||||
.BR ` ,
|
||||
.BR \` ,
|
||||
or
|
||||
.BR \e .
|
||||
The first backquote not preceded by a backslash terminates the
|
||||
@@ -3200,7 +3202,7 @@ must be used to quote the characters
|
||||
.BR \e ,
|
||||
.BR $ ,
|
||||
and
|
||||
.BR ` .
|
||||
.BR \` .
|
||||
.PP
|
||||
If the redirection operator is
|
||||
.BR <<\- ,
|
||||
@@ -3314,7 +3316,7 @@ 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
|
||||
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,
|
||||
|
||||
+17
-13
@@ -5,12 +5,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Tue May 1 10:05:17 EDT 2007
|
||||
.\" Last Change: Fri Sep 14 13:44:37 EDT 2007
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2007 May 1" "GNU Bash-3.2"
|
||||
.TH BASH 1 "2007 September 14" "GNU Bash-3.2"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -944,19 +944,19 @@ 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
|
||||
.BR $ ,
|
||||
.BR ` ,
|
||||
.BR \` ,
|
||||
.BR \e ,
|
||||
and, when history expansion is enabled,
|
||||
.BR ! .
|
||||
The characters
|
||||
.B $
|
||||
and
|
||||
.B `
|
||||
.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 ` ,
|
||||
.BR \` ,
|
||||
\^\fB"\fP\^,
|
||||
.BR \e ,
|
||||
or
|
||||
@@ -1291,8 +1291,8 @@ The command argument to the \fB\-c\fP invocation option.
|
||||
.B BASH_LINENO
|
||||
An array variable whose members are the line numbers in source files
|
||||
corresponding to each member of \fBFUNCNAME\fP.
|
||||
\fB${BASH_LINENO[\fP\fI$i\fP\fB]}\fP is the line number in the source
|
||||
file where \fB${FUNCNAME[\fP\fI$ifP\fB]}\fP was called.
|
||||
\fB${BASH_LINENO[\fP\fI$i-1\fP\fB]}\fP is the line number in the source
|
||||
file where \fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP was called.
|
||||
The corresponding source file name is \fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fB.
|
||||
Use \fBLINENO\fP to obtain the current line number.
|
||||
.TP
|
||||
@@ -2607,7 +2607,7 @@ the command name. There are two forms:
|
||||
.RE
|
||||
or
|
||||
.RS
|
||||
\fB`\fP\fIcommand\fP\fB`\fP
|
||||
\fB\`\fP\fIcommand\fP\fB\`\fP
|
||||
.RE
|
||||
.PP
|
||||
.B Bash
|
||||
@@ -2622,7 +2622,7 @@ the equivalent but faster \fB$(< \fIfile\fP)\fR.
|
||||
When the old-style backquote form of substitution is used,
|
||||
backslash retains its literal meaning except when followed by
|
||||
.BR $ ,
|
||||
.BR ` ,
|
||||
.BR \` ,
|
||||
or
|
||||
.BR \e .
|
||||
The first backquote not preceded by a backslash terminates the
|
||||
@@ -3200,7 +3200,7 @@ must be used to quote the characters
|
||||
.BR \e ,
|
||||
.BR $ ,
|
||||
and
|
||||
.BR ` .
|
||||
.BR \` .
|
||||
.PP
|
||||
If the redirection operator is
|
||||
.BR <<\- ,
|
||||
@@ -3314,7 +3314,7 @@ 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
|
||||
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,
|
||||
@@ -7672,6 +7672,9 @@ any command in a pipeline but the last,
|
||||
or if the command's return value is
|
||||
being inverted via
|
||||
.BR ! .
|
||||
Failing simple commands that are part of shell functions or command lists
|
||||
enclosed in braces or parentheses satisfying the above conditions do not
|
||||
cause the shell to exit.
|
||||
A trap on \fBERR\fP, if set, is executed before the shell exits.
|
||||
.TP 8
|
||||
.B \-f
|
||||
@@ -8592,8 +8595,9 @@ none are found.
|
||||
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 once it
|
||||
is set; a soft limit may be increased up to the value of the hard limit.
|
||||
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
|
||||
|
||||
+12
-6
@@ -3,7 +3,7 @@
|
||||
</HEAD>
|
||||
<BODY><TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2007 May 1<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2007 September 14<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR><A HREF="#index">Index</A>
|
||||
@@ -775,7 +775,7 @@ have equal precedence, followed by
|
||||
<B>;</B>
|
||||
|
||||
and
|
||||
<B>&,</B>
|
||||
<B>&</B>,
|
||||
|
||||
which have equal precedence.
|
||||
<P>
|
||||
@@ -919,6 +919,8 @@ If the shell option
|
||||
|
||||
is enabled, the match is performed without regard to the case
|
||||
of alphabetic characters.
|
||||
Any part of the pattern may be quoted to force it to be matched as a
|
||||
string.
|
||||
Substrings matched by parenthesized subexpressions within the regular
|
||||
expression are saved in the array variable <B>BASH_REMATCH</B>.
|
||||
The element of <B>BASH_REMATCH</B> with index 0 is the portion of the string
|
||||
@@ -9839,6 +9841,9 @@ or if the command's return value is
|
||||
being inverted via
|
||||
<B>!</B>.
|
||||
|
||||
Failing simple commands that are part of shell functions or command lists
|
||||
enclosed in braces or parentheses satisfying the above conditions do not
|
||||
cause the shell to exit.
|
||||
A trap on <B>ERR</B>, if set, is executed before the shell exits.
|
||||
<DT><B>-f</B>
|
||||
|
||||
@@ -11024,8 +11029,9 @@ none are found.
|
||||
Provides control over the resources available to the shell and to
|
||||
processes started by it, on systems that allow such control.
|
||||
The <B>-H</B> and <B>-S</B> options specify that the hard or soft limit is
|
||||
set for the given resource. A hard limit cannot be increased once it
|
||||
is set; a soft limit may be increased up to the value of the hard limit.
|
||||
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 <B>-H</B> nor <B>-S</B> is specified, both the soft and hard
|
||||
limits are set.
|
||||
The value of
|
||||
@@ -11543,7 +11549,7 @@ Array variables may not (yet) be exported.
|
||||
<HR>
|
||||
<TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash-3.2<TH ALIGN=CENTER width=33%>2007 May 1<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash-3.2<TH ALIGN=CENTER width=33%>2007 September 14<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<HR>
|
||||
@@ -11647,6 +11653,6 @@ Array variables may not (yet) be exported.
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by man2html from bash.1.<BR>
|
||||
Time: 11 May 2007 16:18:51 EDT
|
||||
Time: 10 October 2007 09:50:38 EDT
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
Binary file not shown.
+3333
-3314
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -152,7 +152,7 @@
|
||||
@xrdef{The Set Builtin-pg}{49}
|
||||
@xrdef{The Set Builtin-snt}{Section@tie 4.3.1}
|
||||
@xrdef{The Shopt Builtin-title}{The Shopt Builtin}
|
||||
@xrdef{The Shopt Builtin-pg}{52}
|
||||
@xrdef{The Shopt Builtin-pg}{53}
|
||||
@xrdef{The Shopt Builtin-snt}{Section@tie 4.3.2}
|
||||
@xrdef{Special Builtins-title}{Special Builtins}
|
||||
@xrdef{Special Builtins-pg}{57}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
\entry{ulimit}{48}{\code {ulimit}}
|
||||
\entry{unalias}{49}{\code {unalias}}
|
||||
\entry{set}{49}{\code {set}}
|
||||
\entry{shopt}{52}{\code {shopt}}
|
||||
\entry{shopt}{53}{\code {shopt}}
|
||||
\entry{dirs}{79}{\code {dirs}}
|
||||
\entry{popd}{80}{\code {popd}}
|
||||
\entry{pushd}{80}{\code {pushd}}
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@
|
||||
\initial {S}
|
||||
\entry {\code {set}}{49}
|
||||
\entry {\code {shift}}{38}
|
||||
\entry {\code {shopt}}{52}
|
||||
\entry {\code {shopt}}{53}
|
||||
\entry {\code {source}}{47}
|
||||
\entry {\code {suspend}}{89}
|
||||
\initial {T}
|
||||
|
||||
Binary file not shown.
+13
-6
@@ -1,6 +1,6 @@
|
||||
<HTML>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<!-- Created on May, 11 2007 by texi2html 1.64 -->
|
||||
<!-- Created on October, 10 2007 by texi2html 1.64 -->
|
||||
<!--
|
||||
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
|
||||
Karl Berry <karl@freefriends.org>
|
||||
@@ -33,10 +33,10 @@ 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 3.2, 1 May 2007).
|
||||
the Bash shell (version 3.2, 14 September 2007).
|
||||
</P><P>
|
||||
|
||||
This is Edition 3.2, last updated 1 May 2007,
|
||||
This is Edition 3.2, last updated 14 September 2007,
|
||||
of <CITE>The GNU Bash Reference Manual</CITE>,
|
||||
for <CODE>Bash</CODE>, Version 3.2.
|
||||
</P><P>
|
||||
@@ -261,7 +261,7 @@ than by an executable program somewhere in the file system.
|
||||
|
||||
<DT><CODE>control operator</CODE>
|
||||
<DD><A NAME="IDX3"></A>
|
||||
A <CODE>word</CODE> that performs a control function. It is a <CODE>newline</CODE>
|
||||
A <CODE>token</CODE> that performs a control function. It is a <CODE>newline</CODE>
|
||||
or one of the following:
|
||||
<SAMP>`||'</SAMP>, <SAMP>`&&'</SAMP>, <SAMP>`&'</SAMP>, <SAMP>`;'</SAMP>, <SAMP>`;;'</SAMP>,
|
||||
<SAMP>`|'</SAMP>, <SAMP>`('</SAMP>, or <SAMP>`)'</SAMP>.
|
||||
@@ -1313,6 +1313,8 @@ If the shell option <CODE>nocasematch</CODE>
|
||||
(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC61">4.3.2 The Shopt Builtin</A>)
|
||||
is enabled, the match is performed without regard to the case
|
||||
of alphabetic characters.
|
||||
Any part of the pattern may be quoted to force it to be matched as a
|
||||
string.
|
||||
Substrings matched by parenthesized subexpressions within the regular
|
||||
expression are saved in the array variable <CODE>BASH_REMATCH</CODE>.
|
||||
The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string
|
||||
@@ -4731,6 +4733,8 @@ If <VAR>limit</VAR> is given, it is the new value of the specified resource;
|
||||
the special <VAR>limit</VAR> values <CODE>hard</CODE>, <CODE>soft</CODE>, and
|
||||
<CODE>unlimited</CODE> 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 <SAMP>`-H'</SAMP> option is supplied.
|
||||
When setting new limits, if neither <SAMP>`-H'</SAMP> nor <SAMP>`-S'</SAMP> is supplied,
|
||||
@@ -4843,6 +4847,9 @@ part of the test in an <CODE>if</CODE> statement,
|
||||
part of a <CODE>&&</CODE> or <CODE>||</CODE> list,
|
||||
any command in a pipeline but the last,
|
||||
or if the command's return status is being inverted using <CODE>!</CODE>.
|
||||
Failing simple commands that are part of shell functions or command lists
|
||||
enclosed in braces or parentheses satisfying the above conditions do not
|
||||
cause the shell to exit.
|
||||
A trap on <CODE>ERR</CODE>, if set, is executed before the shell exits.
|
||||
<P>
|
||||
|
||||
@@ -15291,7 +15298,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>May, 11 2007</I>
|
||||
This document was generated by <I>Chet Ramey</I> on <I>October, 10 2007</I>
|
||||
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
|
||||
"><I>texi2html</I></A>
|
||||
<P></P>
|
||||
@@ -15453,7 +15460,7 @@ the following structure:
|
||||
<BR>
|
||||
<FONT SIZE="-1">
|
||||
This document was generated
|
||||
by <I>Chet Ramey</I> on <I>May, 11 2007</I>
|
||||
by <I>Chet Ramey</I> on <I>October, 10 2007</I>
|
||||
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
|
||||
"><I>texi2html</I></A>
|
||||
|
||||
|
||||
+152
-145
@@ -2,10 +2,10 @@ This is bashref.info, produced by makeinfo version 4.8 from
|
||||
/Users/chet/src/bash/src/doc/bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 3.2, 1 May 2007).
|
||||
the Bash shell (version 3.2, 14 September 2007).
|
||||
|
||||
This is Edition 3.2, last updated 1 May 2007, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 3.2.
|
||||
This is Edition 3.2, last updated 14 September 2007, of `The GNU
|
||||
Bash Reference Manual', for `Bash', Version 3.2.
|
||||
|
||||
Copyright (C) 1988-2005 Free Software Foundation, Inc.
|
||||
|
||||
@@ -37,10 +37,10 @@ Bash Features
|
||||
*************
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 3.2, 1 May 2007).
|
||||
the Bash shell (version 3.2, 14 September 2007).
|
||||
|
||||
This is Edition 3.2, last updated 1 May 2007, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 3.2.
|
||||
This is Edition 3.2, last updated 14 September 2007, of `The GNU
|
||||
Bash Reference Manual', for `Bash', Version 3.2.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
features that only appear in Bash. Some of the shells that Bash has
|
||||
@@ -183,7 +183,7 @@ These definitions are used throughout the remainder of this manual.
|
||||
rather than by an executable program somewhere in the file system.
|
||||
|
||||
`control operator'
|
||||
A `word' that performs a control function. It is a `newline' or
|
||||
A `token' that performs a control function. It is a `newline' or
|
||||
one of the following: `||', `&&', `&', `;', `;;', `|', `(', or `)'.
|
||||
|
||||
`exit status'
|
||||
@@ -850,12 +850,14 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre
|
||||
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. 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.
|
||||
alphabetic characters. Any part of the pattern may be quoted to
|
||||
force it 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:
|
||||
@@ -3123,8 +3125,10 @@ POSIX standard.
|
||||
If LIMIT is given, it 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. Otherwise, the current value of the soft limit for
|
||||
the specified resource is printed, unless the `-H' option is
|
||||
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,
|
||||
@@ -3193,8 +3197,11 @@ parameters, or to display the names and values of shell variables.
|
||||
a `while' or `until' keyword, part of the test in an `if'
|
||||
statement, part of a `&&' or `||' list, any command in a
|
||||
pipeline but the last, or if the command's return status is
|
||||
being inverted using `!'. A trap on `ERR', if set, is
|
||||
executed before the shell exits.
|
||||
being inverted using `!'. Failing simple commands that are
|
||||
part of shell functions or command lists enclosed in braces
|
||||
or parentheses satisfying the above conditions do not cause
|
||||
the shell to exit. A trap on `ERR', if set, is executed
|
||||
before the shell exits.
|
||||
|
||||
`-f'
|
||||
Disable file name generation (globbing).
|
||||
@@ -9141,7 +9148,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* ulimit: Bash Builtins. (line 430)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 326)
|
||||
* unalias: Bash Builtins. (line 508)
|
||||
* unalias: Bash Builtins. (line 510)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 343)
|
||||
* wait: Job Control Builtins.
|
||||
@@ -9616,132 +9623,132 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top1345
|
||||
Node: Introduction3143
|
||||
Node: What is Bash?3371
|
||||
Node: What is a shell?4484
|
||||
Node: Definitions7024
|
||||
Node: Basic Shell Features9792
|
||||
Node: Shell Syntax11011
|
||||
Node: Shell Operation12041
|
||||
Node: Quoting13335
|
||||
Node: Escape Character14638
|
||||
Node: Single Quotes15123
|
||||
Node: Double Quotes15471
|
||||
Node: ANSI-C Quoting16596
|
||||
Node: Locale Translation17552
|
||||
Node: Comments18448
|
||||
Node: Shell Commands19066
|
||||
Node: Simple Commands19832
|
||||
Node: Pipelines20463
|
||||
Node: Lists22338
|
||||
Node: Compound Commands23969
|
||||
Node: Looping Constructs24753
|
||||
Node: Conditional Constructs27200
|
||||
Node: Command Grouping34672
|
||||
Node: Shell Functions36151
|
||||
Node: Shell Parameters40612
|
||||
Node: Positional Parameters42942
|
||||
Node: Special Parameters43842
|
||||
Node: Shell Expansions46806
|
||||
Node: Brace Expansion48731
|
||||
Node: Tilde Expansion51057
|
||||
Node: Shell Parameter Expansion53408
|
||||
Node: Command Substitution61108
|
||||
Node: Arithmetic Expansion62441
|
||||
Node: Process Substitution63291
|
||||
Node: Word Splitting64341
|
||||
Node: Filename Expansion65964
|
||||
Node: Pattern Matching68104
|
||||
Node: Quote Removal71422
|
||||
Node: Redirections71717
|
||||
Node: Executing Commands79447
|
||||
Node: Simple Command Expansion80117
|
||||
Node: Command Search and Execution82047
|
||||
Node: Command Execution Environment84053
|
||||
Node: Environment86852
|
||||
Node: Exit Status88512
|
||||
Node: Signals89716
|
||||
Node: Shell Scripts91684
|
||||
Node: Shell Builtin Commands94202
|
||||
Node: Bourne Shell Builtins95879
|
||||
Node: Bash Builtins113087
|
||||
Node: Modifying Shell Behavior133075
|
||||
Node: The Set Builtin133420
|
||||
Node: The Shopt Builtin142042
|
||||
Node: Special Builtins152272
|
||||
Node: Shell Variables153251
|
||||
Node: Bourne Shell Variables153691
|
||||
Node: Bash Variables155672
|
||||
Node: Bash Features176967
|
||||
Node: Invoking Bash177850
|
||||
Node: Bash Startup Files183659
|
||||
Node: Interactive Shells188518
|
||||
Node: What is an Interactive Shell?188928
|
||||
Node: Is this Shell Interactive?189577
|
||||
Node: Interactive Shell Behavior190392
|
||||
Node: Bash Conditional Expressions193672
|
||||
Node: Shell Arithmetic197251
|
||||
Node: Aliases199997
|
||||
Node: Arrays202569
|
||||
Node: The Directory Stack205918
|
||||
Node: Directory Stack Builtins206632
|
||||
Node: Printing a Prompt209524
|
||||
Node: The Restricted Shell212238
|
||||
Node: Bash POSIX Mode214070
|
||||
Node: Job Control221829
|
||||
Node: Job Control Basics222296
|
||||
Node: Job Control Builtins226805
|
||||
Node: Job Control Variables231132
|
||||
Node: Command Line Editing232290
|
||||
Node: Introduction and Notation233289
|
||||
Node: Readline Interaction234911
|
||||
Node: Readline Bare Essentials236102
|
||||
Node: Readline Movement Commands237891
|
||||
Node: Readline Killing Commands238856
|
||||
Node: Readline Arguments240776
|
||||
Node: Searching241820
|
||||
Node: Readline Init File244006
|
||||
Node: Readline Init File Syntax245153
|
||||
Node: Conditional Init Constructs257528
|
||||
Node: Sample Init File260061
|
||||
Node: Bindable Readline Commands263178
|
||||
Node: Commands For Moving264385
|
||||
Node: Commands For History265246
|
||||
Node: Commands For Text268401
|
||||
Node: Commands For Killing271074
|
||||
Node: Numeric Arguments273216
|
||||
Node: Commands For Completion274355
|
||||
Node: Keyboard Macros277948
|
||||
Node: Miscellaneous Commands278519
|
||||
Node: Readline vi Mode283830
|
||||
Node: Programmable Completion284744
|
||||
Node: Programmable Completion Builtins290562
|
||||
Node: Using History Interactively298158
|
||||
Node: Bash History Facilities298838
|
||||
Node: Bash History Builtins301752
|
||||
Node: History Interaction305609
|
||||
Node: Event Designators308314
|
||||
Node: Word Designators309329
|
||||
Node: Modifiers310968
|
||||
Node: Installing Bash312372
|
||||
Node: Basic Installation313502
|
||||
Node: Compilers and Options316194
|
||||
Node: Compiling For Multiple Architectures316935
|
||||
Node: Installation Names318599
|
||||
Node: Specifying the System Type319417
|
||||
Node: Sharing Defaults320133
|
||||
Node: Operation Controls320806
|
||||
Node: Optional Features321764
|
||||
Node: Reporting Bugs330695
|
||||
Node: Major Differences From The Bourne Shell331889
|
||||
Node: Copying This Manual348558
|
||||
Node: GNU Free Documentation License348828
|
||||
Node: Indexes371234
|
||||
Node: Builtin Index371677
|
||||
Node: Reserved Word Index378210
|
||||
Node: Variable Index380658
|
||||
Node: Function Index391822
|
||||
Node: Concept Index398554
|
||||
Node: Top1359
|
||||
Node: Introduction3171
|
||||
Node: What is Bash?3399
|
||||
Node: What is a shell?4512
|
||||
Node: Definitions7052
|
||||
Node: Basic Shell Features9821
|
||||
Node: Shell Syntax11040
|
||||
Node: Shell Operation12070
|
||||
Node: Quoting13364
|
||||
Node: Escape Character14667
|
||||
Node: Single Quotes15152
|
||||
Node: Double Quotes15500
|
||||
Node: ANSI-C Quoting16625
|
||||
Node: Locale Translation17581
|
||||
Node: Comments18477
|
||||
Node: Shell Commands19095
|
||||
Node: Simple Commands19861
|
||||
Node: Pipelines20492
|
||||
Node: Lists22367
|
||||
Node: Compound Commands23998
|
||||
Node: Looping Constructs24782
|
||||
Node: Conditional Constructs27229
|
||||
Node: Command Grouping34789
|
||||
Node: Shell Functions36268
|
||||
Node: Shell Parameters40729
|
||||
Node: Positional Parameters43059
|
||||
Node: Special Parameters43959
|
||||
Node: Shell Expansions46923
|
||||
Node: Brace Expansion48848
|
||||
Node: Tilde Expansion51174
|
||||
Node: Shell Parameter Expansion53525
|
||||
Node: Command Substitution61225
|
||||
Node: Arithmetic Expansion62558
|
||||
Node: Process Substitution63408
|
||||
Node: Word Splitting64458
|
||||
Node: Filename Expansion66081
|
||||
Node: Pattern Matching68221
|
||||
Node: Quote Removal71539
|
||||
Node: Redirections71834
|
||||
Node: Executing Commands79564
|
||||
Node: Simple Command Expansion80234
|
||||
Node: Command Search and Execution82164
|
||||
Node: Command Execution Environment84170
|
||||
Node: Environment86969
|
||||
Node: Exit Status88629
|
||||
Node: Signals89833
|
||||
Node: Shell Scripts91801
|
||||
Node: Shell Builtin Commands94319
|
||||
Node: Bourne Shell Builtins95996
|
||||
Node: Bash Builtins113204
|
||||
Node: Modifying Shell Behavior133336
|
||||
Node: The Set Builtin133681
|
||||
Node: The Shopt Builtin142506
|
||||
Node: Special Builtins152736
|
||||
Node: Shell Variables153715
|
||||
Node: Bourne Shell Variables154155
|
||||
Node: Bash Variables156136
|
||||
Node: Bash Features177431
|
||||
Node: Invoking Bash178314
|
||||
Node: Bash Startup Files184123
|
||||
Node: Interactive Shells188982
|
||||
Node: What is an Interactive Shell?189392
|
||||
Node: Is this Shell Interactive?190041
|
||||
Node: Interactive Shell Behavior190856
|
||||
Node: Bash Conditional Expressions194136
|
||||
Node: Shell Arithmetic197715
|
||||
Node: Aliases200461
|
||||
Node: Arrays203033
|
||||
Node: The Directory Stack206382
|
||||
Node: Directory Stack Builtins207096
|
||||
Node: Printing a Prompt209988
|
||||
Node: The Restricted Shell212702
|
||||
Node: Bash POSIX Mode214534
|
||||
Node: Job Control222293
|
||||
Node: Job Control Basics222760
|
||||
Node: Job Control Builtins227269
|
||||
Node: Job Control Variables231596
|
||||
Node: Command Line Editing232754
|
||||
Node: Introduction and Notation233753
|
||||
Node: Readline Interaction235375
|
||||
Node: Readline Bare Essentials236566
|
||||
Node: Readline Movement Commands238355
|
||||
Node: Readline Killing Commands239320
|
||||
Node: Readline Arguments241240
|
||||
Node: Searching242284
|
||||
Node: Readline Init File244470
|
||||
Node: Readline Init File Syntax245617
|
||||
Node: Conditional Init Constructs257992
|
||||
Node: Sample Init File260525
|
||||
Node: Bindable Readline Commands263642
|
||||
Node: Commands For Moving264849
|
||||
Node: Commands For History265710
|
||||
Node: Commands For Text268865
|
||||
Node: Commands For Killing271538
|
||||
Node: Numeric Arguments273680
|
||||
Node: Commands For Completion274819
|
||||
Node: Keyboard Macros278412
|
||||
Node: Miscellaneous Commands278983
|
||||
Node: Readline vi Mode284294
|
||||
Node: Programmable Completion285208
|
||||
Node: Programmable Completion Builtins291026
|
||||
Node: Using History Interactively298622
|
||||
Node: Bash History Facilities299302
|
||||
Node: Bash History Builtins302216
|
||||
Node: History Interaction306073
|
||||
Node: Event Designators308778
|
||||
Node: Word Designators309793
|
||||
Node: Modifiers311432
|
||||
Node: Installing Bash312836
|
||||
Node: Basic Installation313966
|
||||
Node: Compilers and Options316658
|
||||
Node: Compiling For Multiple Architectures317399
|
||||
Node: Installation Names319063
|
||||
Node: Specifying the System Type319881
|
||||
Node: Sharing Defaults320597
|
||||
Node: Operation Controls321270
|
||||
Node: Optional Features322228
|
||||
Node: Reporting Bugs331159
|
||||
Node: Major Differences From The Bourne Shell332353
|
||||
Node: Copying This Manual349022
|
||||
Node: GNU Free Documentation License349292
|
||||
Node: Indexes371698
|
||||
Node: Builtin Index372141
|
||||
Node: Reserved Word Index378674
|
||||
Node: Variable Index381122
|
||||
Node: Function Index392286
|
||||
Node: Concept Index399018
|
||||
|
||||
End Tag Table
|
||||
|
||||
+12
-12
@@ -1,4 +1,4 @@
|
||||
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2006.11.28) 11 MAY 2007 16:18
|
||||
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2006.11.28) 10 OCT 2007 09:50
|
||||
**/Users/chet/src/bash/src/doc/bashref.texi
|
||||
(/Users/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
|
||||
Loading texinfo [version 2003-02-03.16]: Basics,
|
||||
@@ -173,7 +173,7 @@ textttsl pat-tern@texttt ][]) @textttsl command-list @texttt ;;][] esac[][]
|
||||
[11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]
|
||||
[26] [27] [28] [29] [30] [31] [32] Chapter 4 [33] [34] [35] [36] [37] [38]
|
||||
[39] [40] [41]
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 3124--3137
|
||||
Underfull \hbox (badness 5231) in paragraph at lines 3126--3139
|
||||
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
|
||||
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
|
||||
@@ -186,7 +186,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
|
||||
.etc.
|
||||
|
||||
[42] [43] [44] [45]
|
||||
Overfull \hbox (43.33536pt too wide) in paragraph at lines 3467--3467
|
||||
Overfull \hbox (43.33536pt too wide) in paragraph at lines 3469--3469
|
||||
[]@texttt read [-ers] [-a @textttsl aname@texttt ] [-d @textttsl de-lim@texttt
|
||||
] [-n @textttsl nchars@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl ti
|
||||
me-
|
||||
@@ -200,7 +200,7 @@ me-
|
||||
.etc.
|
||||
|
||||
[46] [47] [48] [49] [50] [51] [52] [53]
|
||||
Underfull \hbox (badness 2573) in paragraph at lines 4089--4093
|
||||
Underfull \hbox (badness 2573) in paragraph at lines 4096--4100
|
||||
[] []@textrm Error trac-ing is en-abled: com-mand sub-sti-tu-tion, shell
|
||||
|
||||
@hbox(7.60416+2.12917)x433.62, glue set 2.95305
|
||||
@@ -217,7 +217,7 @@ Underfull \hbox (badness 2573) in paragraph at lines 4089--4093
|
||||
|
||||
[54] [55] [56] Chapter 5 [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
|
||||
Chapter 6 [67] [68]
|
||||
Overfull \hbox (51.96864pt too wide) in paragraph at lines 4905--4905
|
||||
Overfull \hbox (51.96864pt too wide) in paragraph at lines 4912--4912
|
||||
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
|
||||
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -230,7 +230,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (76.23077pt too wide) in paragraph at lines 4906--4906
|
||||
Overfull \hbox (76.23077pt too wide) in paragraph at lines 4913--4913
|
||||
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
|
||||
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
|
||||
-
|
||||
@@ -244,7 +244,7 @@ Overfull \hbox (76.23077pt too wide) in paragraph at lines 4906--4906
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (34.72258pt too wide) in paragraph at lines 4907--4907
|
||||
Overfull \hbox (34.72258pt too wide) in paragraph at lines 4914--4914
|
||||
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
|
||||
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -257,7 +257,7 @@ tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
.etc.
|
||||
|
||||
[69] [70]
|
||||
Underfull \hbox (badness 2245) in paragraph at lines 5081--5083
|
||||
Underfull \hbox (badness 2245) in paragraph at lines 5088--5090
|
||||
[]@textrm When a lo-gin shell ex-its, Bash reads and ex-e-cutes com-mands from
|
||||
the file
|
||||
|
||||
@@ -270,7 +270,7 @@ the file
|
||||
.etc.
|
||||
|
||||
[71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84]
|
||||
Underfull \hbox (badness 2521) in paragraph at lines 6195--6198
|
||||
Underfull \hbox (badness 2521) in paragraph at lines 6202--6205
|
||||
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
|
||||
e[] @textrm when build-ing (see Sec-tion 10.8
|
||||
|
||||
@@ -337,7 +337,7 @@ Underfull \hbox (badness 2753) in paragraph at lines 1769--1772
|
||||
|
||||
[115]) (/Users/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
|
||||
[116] [117] [118] [119] [120]) Chapter 10 [121] [122] [123] [124] [125]
|
||||
Underfull \hbox (badness 2772) in paragraph at lines 6791--6795
|
||||
Underfull \hbox (badness 2772) in paragraph at lines 6798--6802
|
||||
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
|
||||
s/large_
|
||||
|
||||
@@ -374,10 +374,10 @@ Overfull \vbox (45.46959pt too high) has occurred while \output is active
|
||||
Here is how much of TeX's memory you used:
|
||||
1735 strings out of 97980
|
||||
23708 string characters out of 1221004
|
||||
55355 words of memory out of 1000000
|
||||
55369 words of memory out of 1000000
|
||||
2586 multiletter control sequences out of 10000+50000
|
||||
31953 words of font info for 111 fonts, out of 500000 for 2000
|
||||
19 hyphenation exceptions out of 1000
|
||||
15i,8n,11p,269b,474s stack positions out of 1500i,500n,5000p,200000b,5000s
|
||||
|
||||
Output written on bashref.dvi (160 pages, 612084 bytes).
|
||||
Output written on bashref.dvi (160 pages, 612624 bytes).
|
||||
|
||||
+503
-490
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -4395,7 +4395,8 @@ The command argument to the @option{-c} invocation option.
|
||||
An array variable whose members are the line numbers in source files
|
||||
corresponding to each member of @var{FUNCNAME}.
|
||||
@code{$@{BASH_LINENO[$i]@}} is the line number in the source file where
|
||||
@code{$@{FUNCNAME[$i]@}} was called.
|
||||
@code{$@{FUNCNAME[$i]@}} was called (or @code{$@{BASH_LINENO[$i-1]@}} if
|
||||
referenced within another shell function).
|
||||
The corresponding source file name is @code{$@{BASH_SOURCE[$i]@}}.
|
||||
Use @code{LINENO} to obtain the current line number.
|
||||
|
||||
|
||||
@@ -3655,6 +3655,8 @@ If @var{limit} is given, it 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,
|
||||
@@ -3730,6 +3732,9 @@ part of the test in an @code{if} statement,
|
||||
part of a @code{&&} or @code{||} list,
|
||||
any command in a pipeline but the last,
|
||||
or if the command's return status is being inverted using @code{!}.
|
||||
Failing simple commands that are part of shell functions or command lists
|
||||
enclosed in braces or parentheses satisfying the above conditions do not
|
||||
cause the shell to exit.
|
||||
A trap on @code{ERR}, if set, is executed before the shell exits.
|
||||
|
||||
@item -f
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@
|
||||
\secentry{Modifying Shell Behavior}{4}{3}{49}
|
||||
\subsecentry{The Set Builtin}{4}{3}{1}{49}
|
||||
\subsecentry{The Shopt Builtin}{4}{3}{2}{52}
|
||||
\secentry{Special Builtins}{4}{4}{56}
|
||||
\secentry{Special Builtins}{4}{4}{57}
|
||||
\chapentry{Shell Variables}{5}{59}
|
||||
\secentry{Bourne Shell Variables}{5}{1}{59}
|
||||
\secentry{Bash Variables}{5}{2}{59}
|
||||
|
||||
+17
-14
@@ -873,8 +873,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
list immediately following a wwhhiillee or uunnttiill keyword,
|
||||
part of the test in an iiff statement, part of a &&&& or ||||
|
||||
list, any command in a pipeline but the last, or if the
|
||||
command's return value is being inverted via !!. A trap
|
||||
on EERRRR, if set, is executed before the shell exits.
|
||||
command's return value is being inverted via !!. Failing
|
||||
simple commands that are part of shell functions or com-
|
||||
mand lists enclosed in braces or parentheses satisfying
|
||||
the above conditions do not cause the shell to exit. A
|
||||
trap on EERRRR, if set, is executed before the shell exits.
|
||||
--ff Disable pathname expansion.
|
||||
--hh Remember the location of commands as they are looked up
|
||||
for execution. This is enabled by default.
|
||||
@@ -1338,18 +1341,18 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
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 once
|
||||
it is set; a soft limit may be increased up to the value of the
|
||||
hard limit. If neither --HH nor --SS is specified, 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 interpreted as fol-
|
||||
lows:
|
||||
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
|
||||
--cc The maximum size of core files created
|
||||
--dd The maximum size of a process's data segment
|
||||
|
||||
+396
-394
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.19.1
|
||||
%%CreationDate: Fri May 11 16:18:41 2007
|
||||
%%CreationDate: Wed Oct 10 09:50:26 2007
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%DocumentSuppliedResources: procset grops 1.19 1
|
||||
|
||||
+3
-1
@@ -3011,7 +3011,7 @@ run_builtin:
|
||||
if (builtin || func)
|
||||
{
|
||||
if (builtin)
|
||||
unwind_protect_int (executing_builtin);
|
||||
unwind_protect_int (executing_builtin); /* modified in execute_builtin */
|
||||
if (already_forked)
|
||||
{
|
||||
/* reset_terminating_signals (); */ /* XXX */
|
||||
@@ -3309,6 +3309,7 @@ execute_function (var, words, flags, fds_to_close, async, subshell)
|
||||
array_push (bash_source_a, sfile);
|
||||
t = itos (executing_line_number ());
|
||||
array_push (bash_lineno_a, t);
|
||||
itrace("execute_function: pushed %s to BASH_LINENO", t);
|
||||
free (t);
|
||||
#endif
|
||||
|
||||
@@ -3575,6 +3576,7 @@ execute_builtin_or_function (words, builtin, var, redirects,
|
||||
|
||||
/* We do this before undoing the effects of any redirections. */
|
||||
fflush (stdout);
|
||||
fpurge (stdout);
|
||||
if (ferror (stdout))
|
||||
clearerr (stdout);
|
||||
|
||||
|
||||
@@ -1102,7 +1102,7 @@ rl_redisplay ()
|
||||
tx = _rl_col_width (&visible_line[pos], 0, nleft) - visible_wrap_offset;
|
||||
else
|
||||
tx = nleft;
|
||||
if (_rl_last_c_pos > tx)
|
||||
if (tx >= 0 && _rl_last_c_pos > tx)
|
||||
{
|
||||
_rl_backspace (_rl_last_c_pos - tx); /* XXX */
|
||||
_rl_last_c_pos = tx;
|
||||
@@ -1251,7 +1251,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
int current_line, omax, nmax, inv_botlin;
|
||||
{
|
||||
register char *ofd, *ols, *oe, *nfd, *nls, *ne;
|
||||
int temp, lendiff, wsatend, od, nd, twidth;
|
||||
int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
|
||||
int current_invis_chars;
|
||||
int col_lendiff, col_temp;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
@@ -1514,6 +1514,8 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
_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 postion in multibyte mode, but a buffer index when not in a
|
||||
multibyte locale. */
|
||||
@@ -1523,7 +1525,9 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
/* 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 == prompt_physical_chars)
|
||||
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
|
||||
#endif
|
||||
|
||||
@@ -154,7 +154,7 @@ _rl_unget_char (key)
|
||||
{
|
||||
pop_index--;
|
||||
if (pop_index < 0)
|
||||
pop_index = ibuffer_len - 1;
|
||||
pop_index = ibuffer_len;
|
||||
ibuffer[pop_index] = key;
|
||||
return (1);
|
||||
}
|
||||
|
||||
+11
-3
@@ -133,8 +133,11 @@ rl_get_char (key)
|
||||
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);
|
||||
@@ -250,7 +253,8 @@ rl_gather_tyi ()
|
||||
while (chars_avail--)
|
||||
{
|
||||
k = (*rl_getc_function) (rl_instream);
|
||||
rl_stuff_char (k);
|
||||
if (rl_stuff_char (k) == 0)
|
||||
break; /* some problem; no more room */
|
||||
if (k == NEWLINE || k == RETURN)
|
||||
break;
|
||||
}
|
||||
@@ -373,7 +377,11 @@ rl_stuff_char (key)
|
||||
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;
|
||||
@@ -570,7 +578,7 @@ _rl_read_mbstring (first, mb, mlen)
|
||||
|
||||
c = first;
|
||||
memset (mb, 0, mlen);
|
||||
for (i = 0; c > 0 && i < mlen; i++)
|
||||
for (i = 0; c >= 0 && i < mlen; i++)
|
||||
{
|
||||
mb[i] = (char)c;
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
|
||||
+11
-9
@@ -255,19 +255,21 @@ getcwd (buf, size)
|
||||
|
||||
{
|
||||
size_t len = pathbuf + pathsize - pathp;
|
||||
if (buf == NULL)
|
||||
{
|
||||
if (len < (size_t) size)
|
||||
len = size;
|
||||
buf = (char *) malloc (len);
|
||||
if (buf == NULL)
|
||||
goto lose2;
|
||||
}
|
||||
else if ((size_t) size < len)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
#pragma alloca
|
||||
#endif /* _AIX && RISC6000 && !__GNUC__ */
|
||||
|
||||
#if defined (__QNX__)
|
||||
# undef HAVE_LSTAT
|
||||
#endif
|
||||
|
||||
#include <bashtypes.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
@@ -1164,7 +1164,11 @@ command_line_to_word_list (line, 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, nwp, cwp);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
+5
-1
@@ -925,6 +925,7 @@ unbind_compfunc_variables (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");
|
||||
@@ -1083,6 +1084,7 @@ gen_command_matches (cs, text, line, ind, lwords, 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);
|
||||
@@ -1114,7 +1116,9 @@ gen_command_matches (cs, text, line, ind, lwords, nw, cw)
|
||||
}
|
||||
cscmd[cmdlen] = '\0';
|
||||
|
||||
csbuf = command_substitute (cscmd, 0);
|
||||
tw = command_substitute (cscmd, 0);
|
||||
csbuf = tw ? tw->word : (char *)NULL;
|
||||
dispose_word_desc (tw);
|
||||
|
||||
/* Now clean up and destroy everything. */
|
||||
dispose_words (cmdlist);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* shell.c -- GNU's idea of the POSIX shell specification. */
|
||||
|
||||
/* Copyright (C) 1987-2006 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1987-2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -305,6 +305,7 @@ 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));
|
||||
@@ -1393,12 +1394,14 @@ open_shell_script (script_name)
|
||||
GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a);
|
||||
|
||||
array_push (bash_source_a, filename);
|
||||
#if 0
|
||||
if (bash_lineno_a)
|
||||
{
|
||||
t = itos (executing_line_number ());
|
||||
array_push (bash_lineno_a, t);
|
||||
free (t);
|
||||
}
|
||||
#endif
|
||||
array_push (funcname_a, "main");
|
||||
#endif
|
||||
|
||||
@@ -1480,7 +1483,7 @@ open_shell_script (script_name)
|
||||
/* 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_noninteractive ();
|
||||
init_interactive_script ();
|
||||
|
||||
free (filename);
|
||||
return (fd);
|
||||
@@ -1573,8 +1576,8 @@ set_shell_name (argv0)
|
||||
static void
|
||||
init_interactive ()
|
||||
{
|
||||
interactive_shell = startup_state = interactive = 1;
|
||||
expand_aliases = 1;
|
||||
expand_aliases = interactive_shell = startup_state = 1;
|
||||
interactive = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1591,6 +1594,13 @@ init_noninteractive ()
|
||||
#endif /* JOB_CONTROL */
|
||||
}
|
||||
|
||||
static void
|
||||
init_interactive_script ()
|
||||
{
|
||||
init_noninteractive ();
|
||||
expand_aliases = interactive_shell = startup_state = 1;
|
||||
}
|
||||
|
||||
void
|
||||
get_current_user_info ()
|
||||
{
|
||||
|
||||
+1
-1
@@ -329,7 +329,7 @@ hpux10*-*gcc*)
|
||||
SHOBJ_LD='${CC}'
|
||||
# if you have problems linking here, moving the `-Wl,+h,$@' from
|
||||
# SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
|
||||
SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
|
||||
SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s'
|
||||
|
||||
SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
|
||||
SHLIB_LIBSUFF='sl'
|
||||
|
||||
Reference in New Issue
Block a user