mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-27 07:43:07 +02:00
commit bash-20100615 snapshot
This commit is contained in:
+39
-1
@@ -10109,4 +10109,42 @@ variables.c
|
||||
lib/readline/complete.c
|
||||
- change get_y_or_n to always return 1 when in callback mode, so we
|
||||
don't do a blocking read. Have to wait until readline-7.0 to add
|
||||
a state, since that will change public interface
|
||||
a state so we can use callbacks, since that will change public
|
||||
interface
|
||||
|
||||
6/17
|
||||
----
|
||||
subst.c
|
||||
- fix memory leak in parameter_brace_expand: when performing pattern
|
||||
removal with parameter_brace_remove_pattern, make sure `name' is
|
||||
freed. Fixes bug reported by oyvindh@dhampir.no
|
||||
|
||||
6/23
|
||||
----
|
||||
{parse.y,subst.c}
|
||||
- make the ${param//pat/rep}, ${param^pat}, and ${param,pat} expansions
|
||||
require single quotes and double quotes to match when within double
|
||||
quotes. This way every expansion except the Posix ones behaves as
|
||||
bash has always behaved
|
||||
|
||||
subst.c
|
||||
- change remove_upattern and remove_wpattern to return their first
|
||||
argument if nothing matches, change callers to allocate memory
|
||||
appropriately
|
||||
- change remove_pattern to short-circuit and return copy of PARAM
|
||||
if remove_wpattern returns its first argument (indicating no match)
|
||||
rather than convert back to multibyte string, allocating new memory
|
||||
twice and calling wcsrtombs
|
||||
|
||||
6/24
|
||||
----
|
||||
execute_cmd.c
|
||||
- add missing initializers for sh_coproc to eliminate a compiler
|
||||
warning. Patch from Werner Fink <werner@suse.de>
|
||||
|
||||
6/27
|
||||
----
|
||||
parse.y
|
||||
- add `TIMEIGN' token to handle `time -p -- ...'. Pointed out by
|
||||
Laszlo Ersek <lacos@caesar.elte.hu> on austin-group list
|
||||
|
||||
|
||||
@@ -10103,3 +10103,41 @@ variables.c
|
||||
- make sure initialize_shell_variables calls sv_xtracefd if
|
||||
BASH_XTRACEFD is inherited in the shell environment. Fixes but
|
||||
reported by <jsunx1@bellsouth.net>
|
||||
|
||||
6/13
|
||||
----
|
||||
lib/readline/complete.c
|
||||
- change get_y_or_n to always return 1 when in callback mode, so we
|
||||
don't do a blocking read. Have to wait until readline-7.0 to add
|
||||
a state so we can use callbacks, since that will change public
|
||||
interface
|
||||
|
||||
6/17
|
||||
----
|
||||
subst.c
|
||||
- fix memory leak in parameter_brace_expand: when performing pattern
|
||||
removal with parameter_brace_remove_pattern, make sure `name' is
|
||||
freed. Fixes bug reported by oyvindh@dhampir.no
|
||||
|
||||
6/23
|
||||
----
|
||||
{parse.y,subst.c}
|
||||
- make the ${param//pat/rep}, ${param^pat}, and ${param,pat} expansions
|
||||
require single quotes and double quotes to match when within double
|
||||
quotes. This way every expansion except the Posix ones behaves as
|
||||
bash has always behaved
|
||||
|
||||
subst.c
|
||||
- change remove_upattern and remove_wpattern to return their first
|
||||
argument if nothing matches, change callers to allocate memory
|
||||
appropriately
|
||||
- change remove_pattern to short-circuit and return copy of PARAM
|
||||
if remove_wpattern returns its first argument (indicating no match)
|
||||
rather than convert back to multibyte string, allocating new memory
|
||||
twice and calling wcsrtombs
|
||||
|
||||
6/24
|
||||
----
|
||||
execute_cmd.c
|
||||
- add missing initializers for sh_coproc to eliminate a compiler
|
||||
warning. Patch from Werner Fink <werner@suse.de>
|
||||
|
||||
@@ -778,6 +778,7 @@ tests/builtins.tests f
|
||||
tests/builtins.right f
|
||||
tests/builtins1.sub f
|
||||
tests/builtins2.sub f
|
||||
tests/builtins3.sub f
|
||||
tests/source1.sub f
|
||||
tests/source2.sub f
|
||||
tests/source3.sub f
|
||||
@@ -941,6 +942,8 @@ tests/posixexp.tests f
|
||||
tests/posixexp.right f
|
||||
tests/posixpat.tests f
|
||||
tests/posixpat.right f
|
||||
tests/posixpipe.tests f
|
||||
tests/posixpipe.right f
|
||||
tests/prec.right f
|
||||
tests/precedence f
|
||||
tests/printf.tests f
|
||||
@@ -1032,6 +1035,7 @@ tests/run-nquote5 f
|
||||
tests/run-posix2 f
|
||||
tests/run-posixexp f
|
||||
tests/run-posixpat f
|
||||
tests/run-posixpipe f
|
||||
tests/run-precedence f
|
||||
tests/run-printf f
|
||||
tests/run-quote f
|
||||
|
||||
@@ -439,6 +439,7 @@ lib/sh/ufuncs.c f
|
||||
lib/sh/unicode.c f
|
||||
lib/sh/vprint.c f
|
||||
lib/sh/wcsdup.c f
|
||||
lib/sh/wcswidth.c f
|
||||
lib/sh/winsize.c f
|
||||
lib/sh/zcatfd.c f
|
||||
lib/sh/zgetline.c f
|
||||
@@ -940,6 +941,8 @@ tests/posixexp.tests f
|
||||
tests/posixexp.right f
|
||||
tests/posixpat.tests f
|
||||
tests/posixpat.right f
|
||||
tests/posixpipe.tests f
|
||||
tests/posixpipe.right f
|
||||
tests/prec.right f
|
||||
tests/precedence f
|
||||
tests/printf.tests f
|
||||
@@ -1031,6 +1034,7 @@ tests/run-nquote5 f
|
||||
tests/run-posix2 f
|
||||
tests/run-posixexp f
|
||||
tests/run-posixpat f
|
||||
tests/run-posixpipe f
|
||||
tests/run-precedence f
|
||||
tests/run-printf f
|
||||
tests/run-quote f
|
||||
|
||||
@@ -334,6 +334,7 @@ evalstring.o: $(topdir)/externs.h $(topdir)/jobs.h $(topdir)/builtins.h
|
||||
evalstring.o: $(topdir)/flags.h $(topdir)/input.h $(topdir)/execute_cmd.h
|
||||
evalstring.o: $(topdir)/bashhist.h $(srcdir)/common.h
|
||||
evalstring.o: $(topdir)/trap.h $(topdir)/redir.h ../pathnames.h
|
||||
evalstring.o: $(BUILD_DIR)/y.tab.h
|
||||
getopt.o: ../config.h $(BASHINCDIR)/memalloc.h
|
||||
getopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(topdir)/command.h
|
||||
getopt.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
|
||||
@@ -0,0 +1,659 @@
|
||||
# This Makefile for building libbuiltins.a is in -*- text -*- for Emacs.
|
||||
#
|
||||
# Copyright (C) 1996-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
PACKAGE = @PACKAGE_NAME@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
|
||||
#
|
||||
SHELL = @MAKE_SHELL@
|
||||
RANLIB = @RANLIB@
|
||||
CC = @CC@
|
||||
CC_FOR_BUILD = @CC_FOR_BUILD@
|
||||
AR = @AR@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
RM = rm -f
|
||||
CP = cp
|
||||
|
||||
EXEEXT = @EXEEXT@
|
||||
|
||||
prefix = @prefix@
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = .:@srcdir@
|
||||
topdir = @top_srcdir@
|
||||
|
||||
datarootdir = @datarootdir@
|
||||
|
||||
includedir = @includedir@
|
||||
datadir = @datadir@
|
||||
localedir = @localedir@
|
||||
|
||||
# Support an alternate destination root directory for package building
|
||||
DESTDIR =
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
BUILD_DIR = @BUILD_DIR@
|
||||
|
||||
LIBBUILD = ${BUILD_DIR}/lib
|
||||
|
||||
PROFILE_FLAGS = @PROFILE_FLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ @CROSS_COMPILE@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
|
||||
LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG}
|
||||
DEFS = @DEFS@
|
||||
LOCAL_DEFS = @LOCAL_DEFS@
|
||||
|
||||
LIBS = @LIBS@
|
||||
LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
|
||||
LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD)
|
||||
LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
|
||||
#LIBS_FOR_BUILD = @LIBS_FOR_BUILD@
|
||||
LIBS_FOR_BUILD = $(LIBS)
|
||||
|
||||
BASHINCDIR = ${topdir}/include
|
||||
|
||||
RL_INCLUDEDIR = @RL_INCLUDEDIR@
|
||||
|
||||
INTL_LIBSRC = ${topdir}/lib/intl
|
||||
INTL_BUILDDIR = ${LIBBUILD}/intl
|
||||
INTL_LIBDIR = ${INTL_BUILDDIR}
|
||||
INTL_LIBRARY = ${INTL_BUILDDIR}/libintl.a
|
||||
INTL_INC = @INTL_INC@
|
||||
INTL_DEP = @INTL_DEP@
|
||||
LIBINTL_H = @LIBINTL_H@
|
||||
|
||||
HELPDIR = @HELPDIR@
|
||||
MKDIRS = ${topdir}/support/mkdirs
|
||||
|
||||
INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib -I$(srcdir) ${INTL_INC}
|
||||
|
||||
BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \
|
||||
${INCLUDES} $(LOCAL_CFLAGS)
|
||||
|
||||
CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
|
||||
|
||||
GCC_LINT_FLAGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \
|
||||
-Wcast-align -Wstrict-prototypes -Wconversion \
|
||||
-Wmissing-prototypes -Wtraditional -Wredundant-decls -pedantic
|
||||
|
||||
MKBUILTINS = mkbuiltins$(EXEEXT)
|
||||
DIRECTDEFINE = -D $(srcdir)
|
||||
HELPDIRDEFINE = @HELPDIRDEFINE@
|
||||
HELPSTRINGS = @HELPSTRINGS@
|
||||
|
||||
# xxx this is bad style
|
||||
RL_LIBSRC = $(topdir)/lib/readline
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .def .c .o
|
||||
# How to make a .o file from a .def file.
|
||||
.def.o:
|
||||
$(RM) $@
|
||||
./$(MKBUILTINS) $(DIRECTDEFINE) $<
|
||||
$(CC) -c $(CCFLAGS) $*.c || ( $(RM) $*.c ; exit 1 )
|
||||
$(RM) $*.c
|
||||
|
||||
# How to make a .c file from a .def file.
|
||||
.def.c:
|
||||
$(RM) $@
|
||||
./$(MKBUILTINS) $(DIRECTDEFINE) $<
|
||||
|
||||
# default rule for making a .o file from a .c file
|
||||
.c.o:
|
||||
$(RM) $@
|
||||
$(CC) -c $(CCFLAGS) $<
|
||||
|
||||
DEFSRC = $(srcdir)/alias.def $(srcdir)/bind.def $(srcdir)/break.def \
|
||||
$(srcdir)/builtin.def $(srcdir)/caller.def \
|
||||
$(srcdir)/cd.def $(srcdir)/colon.def \
|
||||
$(srcdir)/command.def $(srcdir)/declare.def $(srcdir)/echo.def \
|
||||
$(srcdir)/enable.def $(srcdir)/eval.def $(srcdir)/getopts.def \
|
||||
$(srcdir)/exec.def $(srcdir)/exit.def $(srcdir)/fc.def \
|
||||
$(srcdir)/fg_bg.def $(srcdir)/hash.def $(srcdir)/help.def \
|
||||
$(srcdir)/history.def $(srcdir)/jobs.def $(srcdir)/kill.def \
|
||||
$(srcdir)/let.def $(srcdir)/read.def $(srcdir)/return.def \
|
||||
$(srcdir)/set.def $(srcdir)/setattr.def $(srcdir)/shift.def \
|
||||
$(srcdir)/source.def $(srcdir)/suspend.def $(srcdir)/test.def \
|
||||
$(srcdir)/times.def $(srcdir)/trap.def $(srcdir)/type.def \
|
||||
$(srcdir)/ulimit.def $(srcdir)/umask.def $(srcdir)/wait.def \
|
||||
$(srcdir)/reserved.def $(srcdir)/pushd.def $(srcdir)/shopt.def \
|
||||
$(srcdir)/printf.def $(srcdir)/complete.def $(srcdir)/mapfile.def
|
||||
|
||||
STATIC_SOURCE = common.c evalstring.c evalfile.c getopt.c bashgetopt.c \
|
||||
getopt.h
|
||||
|
||||
OFILES = builtins.o \
|
||||
alias.o bind.o break.o builtin.o caller.o cd.o colon.o command.o \
|
||||
common.o declare.o echo.o enable.o eval.o evalfile.o \
|
||||
evalstring.o exec.o exit.o fc.o fg_bg.o hash.o help.o history.o \
|
||||
jobs.o kill.o let.o mapfile.o \
|
||||
pushd.o read.o return.o set.o setattr.o shift.o source.o \
|
||||
suspend.o test.o times.o trap.o type.o ulimit.o umask.o \
|
||||
wait.o getopts.o shopt.o printf.o getopt.o bashgetopt.o complete.o
|
||||
|
||||
CREATED_FILES = builtext.h builtins.c psize.aux pipesize.h
|
||||
|
||||
all: $(MKBUILTINS) libbuiltins.a
|
||||
|
||||
libbuiltins.a: $(MKBUILTINS) $(OFILES) builtins.o
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ $(OFILES)
|
||||
-$(RANLIB) $@
|
||||
|
||||
builtext.h builtins.c: $(MKBUILTINS) $(DEFSRC)
|
||||
@-if test -f builtins.c; then mv -f builtins.c old-builtins.c; fi
|
||||
@-if test -f builtext.h; then mv -f builtext.h old-builtext.h; fi
|
||||
./$(MKBUILTINS) -externfile builtext.h -structfile builtins.c \
|
||||
-noproduction $(DIRECTDEFINE) $(HELPDIRDEFINE) $(HELPSTRINGS) $(DEFSRC)
|
||||
@-if cmp -s old-builtext.h builtext.h 2>/dev/null; then \
|
||||
mv old-builtext.h builtext.h; \
|
||||
else \
|
||||
$(RM) old-builtext.h; \
|
||||
fi
|
||||
@-if cmp -s old-builtins.c builtins.c 2>/dev/null; then \
|
||||
mv old-builtins.c builtins.c; \
|
||||
else \
|
||||
$(RM) old-builtins.c; \
|
||||
fi
|
||||
|
||||
helpdoc: $(MKBUILTINS) $(DEFSRC)
|
||||
./$(MKBUILTINS) ${HELPDIRDEFINE} -noproduction $(DIRECTDEFINE) $(DEFSRC)
|
||||
|
||||
install-help:
|
||||
@-if test -n "${HELPDIR}" && test -d helpfiles ; then \
|
||||
test -d $(DESTDIR)${HELPDIR} || ${SHELL} ${MKDIRS} $(DESTDIR)$(HELPDIR) ;\
|
||||
( for f in helpfiles/*; do \
|
||||
echo installing $$f; \
|
||||
${INSTALL_DATA} $$f $(DESTDIR)$(HELPDIR); \
|
||||
done; ) ; \
|
||||
fi
|
||||
|
||||
install: @HELPINSTALL@
|
||||
|
||||
mkbuiltins.o: ../config.h
|
||||
mkbuiltins.o: mkbuiltins.c
|
||||
$(RM) $@
|
||||
$(CC_FOR_BUILD) -c $(CCFLAGS_FOR_BUILD) $<
|
||||
|
||||
mkbuiltins$(EXEEXT): mkbuiltins.o
|
||||
$(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $(MKBUILTINS) mkbuiltins.o $(LIBS_FOR_BUILD)
|
||||
|
||||
# rules for deficient makes, like SunOS
|
||||
mkbuiltins.o: mkbuiltins.c
|
||||
builtins.o: builtins.c
|
||||
common.o: common.c
|
||||
bashgetopt.o: bashgetopt.c
|
||||
getopt.o: getopt.c
|
||||
evalstring.o: evalstring.c
|
||||
evalfile.o: evalfile.c
|
||||
|
||||
ulimit.o: pipesize.h
|
||||
|
||||
pipesize.h: psize.aux
|
||||
$(SHELL) $(srcdir)/psize.sh > $@
|
||||
|
||||
psize.aux: psize.c
|
||||
$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(srcdir)/psize.c
|
||||
|
||||
documentation: builtins.texi
|
||||
|
||||
builtins.texi: $(MKBUILTINS)
|
||||
./$(MKBUILTINS) -documentonly $(DEFSRC)
|
||||
|
||||
clean:
|
||||
$(RM) $(OFILES) $(CREATED_FILES) $(MKBUILTINS) mkbuiltins.o libbuiltins.a
|
||||
-test -d helpfiles && $(RM) -r helpfiles
|
||||
|
||||
mostlyclean:
|
||||
$(RM) $(OFILES) libbuiltins.a
|
||||
|
||||
distclean maintainer-clean: clean
|
||||
$(RM) Makefile
|
||||
|
||||
$(OFILES): $(MKBUILTINS) ../config.h
|
||||
|
||||
../version.h: ../config.h ../Makefile Makefile
|
||||
-( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} version.h )
|
||||
|
||||
# maintainer special - for now
|
||||
po: builtins.c
|
||||
xgettext -L C -o $(topdir)/po/builtins.pot --keyword='N_' builtins.c 2>/dev/null
|
||||
|
||||
${LIBINTL_H}:
|
||||
@echo making $@ in ${INTL_BUILDDIR}
|
||||
@(cd ${INTL_BUILDDIR} && \
|
||||
$(MAKE) $(MFLAGS) libintl.h) || exit 1
|
||||
|
||||
# dependencies
|
||||
|
||||
alias.o: alias.def
|
||||
bind.o: bind.def
|
||||
break.o: break.def
|
||||
builtin.o: builtin.def
|
||||
caller.o: caller.def
|
||||
cd.o: cd.def
|
||||
colon.o: colon.def
|
||||
command.o: command.def
|
||||
declare.o: declare.def
|
||||
echo.o: echo.def
|
||||
enable.o: enable.def
|
||||
eval.o: eval.def
|
||||
exec.o: exec.def
|
||||
exit.o: exit.def
|
||||
fc.o: fc.def
|
||||
fg_bg.o: fg_bg.def
|
||||
hash.o: hash.def
|
||||
help.o: help.def
|
||||
history.o: history.def
|
||||
jobs.o: jobs.def
|
||||
kill.o: kill.def
|
||||
let.o: let.def
|
||||
mapfile.o: mapfile.def
|
||||
printf.o: printf.def
|
||||
pushd.o: pushd.def
|
||||
read.o: read.def
|
||||
return.o: return.def
|
||||
set.o: set.def
|
||||
setattr.o: setattr.def
|
||||
shift.o: shift.def
|
||||
shopt.o: shopt.def
|
||||
source.o: source.def
|
||||
suspend.o: suspend.def
|
||||
test.o: test.def
|
||||
times.o: times.def
|
||||
trap.o: trap.def
|
||||
type.o: type.def
|
||||
ulimit.o: ulimit.def
|
||||
umask.o: umask.def
|
||||
wait.o: wait.def
|
||||
getopts.o: getopts.def
|
||||
reserved.o: reserved.def
|
||||
complete.o: complete.def
|
||||
|
||||
# C files
|
||||
bashgetopt.o: ../config.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
|
||||
bashgetopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h
|
||||
bashgetopt.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h
|
||||
bashgetopt.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/quit.h $(BASHINCDIR)/maxpath.h
|
||||
bashgetopt.o: $(topdir)/unwind_prot.h $(topdir)/dispose_cmd.h
|
||||
bashgetopt.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/sig.h
|
||||
bashgetopt.o: ../pathnames.h $(topdir)/externs.h $(srcdir)/common.h
|
||||
bashgetopt.o: $(BASHINCDIR)/chartypes.h
|
||||
common.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
|
||||
common.o: $(topdir)/shell.h $(topdir)/syntax.h ../config.h $(topdir)/bashjmp.h $(BASHINCDIR)/posixjmp.h
|
||||
common.o: $(topdir)/sig.h $(topdir)/command.h
|
||||
common.o: $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/stdc.h $(BASHINCDIR)/memalloc.h
|
||||
common.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/input.h
|
||||
common.o: $(topdir)/siglist.h $(topdir)/bashhist.h $(topdir)/quit.h
|
||||
common.o: $(topdir)/unwind_prot.h $(BASHINCDIR)/maxpath.h $(topdir)/jobs.h
|
||||
common.o: $(topdir)/builtins.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
common.o: $(topdir)/subst.h $(topdir)/execute_cmd.h $(topdir)/error.h
|
||||
common.o: $(topdir)/externs.h ../pathnames.h ./builtext.h
|
||||
common.o: $(BASHINCDIR)/chartypes.h
|
||||
evalfile.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h ${BASHINCDIR}/filecntl.h
|
||||
evalfile.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
|
||||
evalfile.o: $(topdir)/shell.h $(topdir)/syntax.h ../config.h $(topdir)/bashjmp.h
|
||||
evalfile.o: $(topdir)/command.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h
|
||||
evalfile.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/quit.h $(BASHINCDIR)/maxpath.h
|
||||
evalfile.o: $(topdir)/unwind_prot.h $(topdir)/dispose_cmd.h
|
||||
evalfile.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/sig.h
|
||||
evalfile.o: ../pathnames.h $(topdir)/externs.h
|
||||
evalfile.o: $(topdir)/jobs.h $(topdir)/builtins.h $(topdir)/flags.h
|
||||
evalfile.o: $(topdir)/input.h $(topdir)/execute_cmd.h
|
||||
evalfile.o: $(topdir)/bashhist.h $(srcdir)/common.h
|
||||
evalstring.o: ../config.h $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
|
||||
evalstring.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(BASHINCDIR)/posixjmp.h
|
||||
evalstring.o: $(topdir)/sig.h $(topdir)/command.h $(topdir)/siglist.h
|
||||
evalstring.o: $(BASHINCDIR)/memalloc.h $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/input.h
|
||||
evalstring.o: $(topdir)/quit.h $(topdir)/unwind_prot.h
|
||||
evalstring.o: $(BASHINCDIR)/maxpath.h $(topdir)/jobs.h $(topdir)/builtins.h
|
||||
evalstring.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
evalstring.o: $(topdir)/externs.h $(topdir)/jobs.h $(topdir)/builtins.h
|
||||
evalstring.o: $(topdir)/flags.h $(topdir)/input.h $(topdir)/execute_cmd.h
|
||||
evalstring.o: $(topdir)/bashhist.h $(srcdir)/common.h
|
||||
evalstring.o: $(topdir)/trap.h $(topdir)/redir.h ../pathnames.h
|
||||
getopt.o: ../config.h $(BASHINCDIR)/memalloc.h
|
||||
getopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(topdir)/command.h
|
||||
getopt.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/error.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
getopt.o: $(topdir)/quit.h $(BASHINCDIR)/maxpath.h $(topdir)/unwind_prot.h
|
||||
getopt.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
getopt.o: $(topdir)/sig.h ../pathnames.h $(topdir)/externs.h
|
||||
getopt.o: $(srcdir)/getopt.h
|
||||
mkbuiltins.o: ../config.h $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h
|
||||
mkbuiltins.o: ${BASHINCDIR}/filecntl.h
|
||||
mkbuiltins.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h
|
||||
|
||||
# def files
|
||||
alias.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
alias.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h
|
||||
alias.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
alias.o: $(topdir)/subst.h $(topdir)/externs.h $(srcdir)/common.h
|
||||
alias.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
alias.o: ../pathnames.h
|
||||
bind.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
bind.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
bind.o: $(topdir)/subst.h $(topdir)/externs.h $(srcdir)/bashgetopt.h
|
||||
bind.o: $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h $(topdir)/bashline.h
|
||||
bind.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
bind.o: ../pathnames.h
|
||||
break.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
break.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
break.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
break.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
break.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
break.o: ../pathnames.h
|
||||
builtin.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
builtin.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/externs.h
|
||||
builtin.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
|
||||
builtin.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
builtin.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
builtin.o: $(srcdir)/bashgetopt.h ../pathnames.h
|
||||
caller.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
caller.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(topdir)/dispose_cmd.h
|
||||
caller.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
caller.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
caller.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ./builtext.h
|
||||
caller.o: ${BASHINCDIR}/chartypes.h $(topdir)/bashtypes.h ../pathnames.h
|
||||
cd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
cd.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(topdir)/dispose_cmd.h
|
||||
cd.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
cd.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
cd.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
command.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
command.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/externs.h
|
||||
command.o: $(topdir)/quit.h $(srcdir)/bashgetopt.h $(BASHINCDIR)/maxpath.h
|
||||
command.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
command.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
command.o: ../pathnames.h
|
||||
declare.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
declare.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
declare.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
declare.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
declare.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
declare.o: $(topdir)/arrayfunc.h $(srcdir)/bashgetopt.h
|
||||
declare.o: ./builtext.h ../pathnames.h
|
||||
echo.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
echo.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
echo.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
echo.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
echo.o: $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
enable.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
enable.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
enable.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
enable.o: $(topdir)/subst.h $(topdir)/externs.h
|
||||
enable.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
enable.o: $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
enable.o: $(topdir)/pcomplete.h
|
||||
eval.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
eval.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
eval.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
eval.o: $(topdir)/subst.h $(topdir)/externs.h
|
||||
eval.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
eval.o: $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
exec.o: $(topdir)/bashtypes.h
|
||||
exec.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
exec.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
exec.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
exec.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/flags.h
|
||||
exec.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
exec.o: $(srcdir)/common.h $(topdir)/execute_cmd.h $(BASHINCDIR)/maxpath.h
|
||||
exec.o: $(topdir)/findcmd.h $(topdir)/jobs.h ../pathnames.h
|
||||
exit.o: $(topdir)/bashtypes.h
|
||||
exit.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
exit.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
exit.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
exit.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/jobs.h
|
||||
exit.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
exit.o: $(BASHINCDIR)/maxpath.h ./builtext.h ../pathnames.h
|
||||
fc.o: $(topdir)/bashtypes.h $(BASHINCDIR)/posixstat.h
|
||||
fc.o: $(topdir)/builtins.h $(topdir)/command.h $(srcdir)/bashgetopt.h
|
||||
fc.o: $(topdir)/bashhist.h
|
||||
fc.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
fc.o: $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h
|
||||
fc.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
fc.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/shell.h $(topdir)/syntax.h
|
||||
fc.o: $(topdir)/flags.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
fc.o: $(topdir)/bashansi.h $(BASHINCDIR)/ansi_stdlib.h $(BASHINCDIR)/chartypes.h
|
||||
fc.o: ../pathnames.h
|
||||
fg_bg.o: $(topdir)/bashtypes.h $(srcdir)/bashgetopt.h
|
||||
fg_bg.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
fg_bg.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
fg_bg.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
fg_bg.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
fg_bg.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
fg_bg.o: $(topdir)/jobs.h ../pathnames.h
|
||||
getopts.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
getopts.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
getopts.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
getopts.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
getopts.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
getopts.o: ../pathnames.h
|
||||
hash.o: $(topdir)/builtins.h $(topdir)/command.h $(topdir)/quit.h
|
||||
hash.o: $(topdir)/findcmd.h $(topdir)/hashlib.h
|
||||
hash.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
hash.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
hash.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
hash.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
help.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
help.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
help.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
help.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
help.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
help.o: ${srcdir}/common.h ../pathnames.h
|
||||
history.o: $(topdir)/bashtypes.h
|
||||
history.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
history.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
history.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
history.o: $(topdir)/subst.h $(topdir)/externs.h
|
||||
history.o: ${BASHINCDIR}/filecntl.h $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h
|
||||
history.o: $(topdir)/variables.h $(topdir)/conftypes.h $(topdir)/bashhist.h $(BASHINCDIR)/maxpath.h
|
||||
history.o: ../pathnames.h
|
||||
inlib.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
inlib.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
inlib.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
inlib.o: $(BASHINCDIR)/maxpath.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
inlib.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h ../pathnames.h
|
||||
jobs.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
jobs.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/quit.h $(srcdir)/bashgetopt.h
|
||||
jobs.o: $(BASHINCDIR)/maxpath.h $(topdir)/externs.h $(topdir)/jobs.h
|
||||
jobs.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
jobs.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
jobs.o: ../pathnames.h
|
||||
kill.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
kill.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
kill.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
kill.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/trap.h $(topdir)/unwind_prot.h
|
||||
kill.o: $(topdir)/variables.h $(topdir)/conftypes.h $(BASHINCDIR)/maxpath.h
|
||||
kill.o: $(topdir)/jobs.h ../pathnames.h
|
||||
let.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
let.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
let.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
let.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
let.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
let.o: ../pathnames.h
|
||||
printf.o: ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/bashjmp.h
|
||||
printf.o: $(topdir)/command.h $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
printf.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
printf.o: $(topdir)/subst.h $(topdir)/externs.h $(topdir)/sig.h
|
||||
printf.o: ../pathnames.h $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h
|
||||
printf.o: $(topdir)/variables.h $(topdir)/conftypes.h $(BASHINCDIR)/stdc.h $(srcdir)/bashgetopt.h
|
||||
printf.o: $(topdir)/bashtypes.h ${srcdir}/common.h $(BASHINCDIR)/chartypes.h
|
||||
printf.o: ../pathnames.h
|
||||
pushd.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
pushd.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
pushd.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
pushd.o: $(topdir)/subst.h $(topdir)/externs.h
|
||||
pushd.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
pushd.o: $(BASHINCDIR)/maxpath.h $(srcdir)/common.h ./builtext.h
|
||||
pushd.o: ../pathnames.h
|
||||
read.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
read.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
read.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
read.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
read.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
read.o: $(BASHINCDIR)/shtty.h
|
||||
read.o: $(topdir)/arrayfunc.h ../pathnames.h
|
||||
return.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
return.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
return.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
return.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
return.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
return.o: ../pathnames.h
|
||||
set.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
set.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
set.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
set.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
set.o: $(BASHINCDIR)/maxpath.h $(topdir)/error.h
|
||||
set.o: $(topdir)/arrayfunc.h ../pathnames.h
|
||||
setattr.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
setattr.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(BASHINCDIR)/maxpath.h
|
||||
setattr.o: $(topdir)/quit.h $(srcdir)/common.h $(srcdir)/bashgetopt.h
|
||||
setattr.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
setattr.o: $(topdir)/externs.h
|
||||
setattr.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
setattr.o: $(topdir)/arrayfunc.h ../pathnames.h
|
||||
shift.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
shift.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
shift.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
shift.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
shift.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
shift.o: ../pathnames.h
|
||||
shopt.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
shopt.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
shopt.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
shopt.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
shopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
shopt.o: $(srcdir)/common.h $(srcdir)/bashgetopt.h ../pathnames.h
|
||||
shopt.o: $(topdir)/bashhist.h
|
||||
source.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
source.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/findcmd.h
|
||||
source.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
source.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
source.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
source.o: $(srcdir)/bashgetopt.h $(topdir)/flags.h $(topdir)/trap.h
|
||||
source.o: ../pathnames.h
|
||||
suspend.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
suspend.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
suspend.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
suspend.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
suspend.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
suspend.o: $(topdir)/jobs.h ../pathnames.h
|
||||
test.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
test.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
test.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
test.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
test.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
test.o: $(topdir)/test.h ../pathnames.h
|
||||
times.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
times.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
times.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
times.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
times.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
times.o: $(BASHINCDIR)/posixtime.h ../pathnames.h
|
||||
trap.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
trap.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/externs.h
|
||||
trap.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
|
||||
trap.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
trap.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
trap.o: $(topdir)/findcmd.h ../pathnames.h
|
||||
type.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
type.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
type.o: $(topdir)/quit.h $(srcdir)/common.h $(BASHINCDIR)/maxpath.h
|
||||
type.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
|
||||
type.o: $(topdir)/externs.h $(topdir)/hashcmd.h ../pathnames.h
|
||||
type.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
ulimit.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
ulimit.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
ulimit.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
ulimit.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
ulimit.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
ulimit.o: ../pathnames.h
|
||||
umask.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
umask.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
umask.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
umask.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
umask.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
umask.o: $(BASHINCDIR)/chartypes.h ../pathnames.h
|
||||
wait.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
wait.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
wait.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
wait.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
wait.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
wait.o: $(topdir)/jobs.h
|
||||
wait.o: $(BASHINCDIR)/chartypes.h ../pathnames.h
|
||||
|
||||
complete.o: ../config.h ../pathnames.h
|
||||
complete.o: ${topdir}/shell.h $(topdir)/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h ${topdir}/sig.h
|
||||
complete.o: ${topdir}/unwind_prot.h ${topdir}/variables.h
|
||||
complete.o: ${topdir}/bashtypes.h ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
|
||||
complete.o: ${topdir}/builtins.h
|
||||
complete.o: ${topdir}/pcomplete.h
|
||||
complete.o: ${srcdir}/common.h ${srcdir}/bashgetopt.h
|
||||
mapfile.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
mapfile.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
mapfile.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
mapfile.o: $(topdir)/subst.h $(topdir)/externs.h $(BASHINCDIR)/maxpath.h
|
||||
mapfile.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
mapfile.o: $(topdir)/arrayfunc.h ../pathnames.h
|
||||
|
||||
#bind.o: $(RL_LIBSRC)chardefs.h $(RL_LIBSRC)readline.h $(RL_LIBSRC)keymaps.h
|
||||
|
||||
# libintl dependencies
|
||||
bind.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
break.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
caller.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
cd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
common.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
complete.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
declare.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
enable.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
evalfile.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
exec.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
exit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
fc.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
fg_bg.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
getopt.c: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
hash.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
help.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
history.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
inlib.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
jobs.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
kill.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
let.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
mapfile.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
mkbuiltins.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
printf.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
pushd.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
read.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
return.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
set.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
setattr.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
shift.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
shopt.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
source.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
suspend.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
type.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
ulimit.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
umask.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
|
||||
+1
-1
@@ -1548,7 +1548,7 @@ static struct cpelement *cpl_search __P((pid_t));
|
||||
static struct cpelement *cpl_searchbyname __P((char *));
|
||||
static void cpl_prune __P((void));
|
||||
|
||||
Coproc sh_coproc = { 0, NO_PID, -1, -1, 0, 0 };
|
||||
Coproc sh_coproc = { 0, NO_PID, -1, -1, 0, 0, 0, 0 };
|
||||
|
||||
cplist_t coproc_list = {0, 0, 0};
|
||||
|
||||
|
||||
+2
-1
@@ -136,6 +136,7 @@ static int builtin_status __P((int));
|
||||
|
||||
static int execute_for_command __P((FOR_COM *));
|
||||
#if defined (SELECT_COMMAND)
|
||||
static int displen __P((const char *));
|
||||
static int print_index_and_element __P((int, int, WORD_LIST *));
|
||||
static void indent __P((int, int));
|
||||
static void print_select_list __P((WORD_LIST *, int, int, int));
|
||||
@@ -2641,7 +2642,7 @@ static int LINES, COLS, tabsize;
|
||||
|
||||
static int
|
||||
displen (s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
wchar_t *wcstr;
|
||||
|
||||
@@ -336,7 +336,7 @@ static REDIRECTEE redir;
|
||||
third group are recognized only under special circumstances. */
|
||||
%token IF THEN ELSE ELIF FI CASE ESAC FOR SELECT WHILE UNTIL DO DONE FUNCTION COPROC
|
||||
%token COND_START COND_END COND_ERROR
|
||||
%token IN BANG TIME TIMEOPT
|
||||
%token IN BANG TIME TIMEOPT TIMEIGN
|
||||
|
||||
/* More general tokens. yylex () knows how to make these. */
|
||||
%token <word> WORD ASSIGNMENT_WORD REDIR_WORD
|
||||
@@ -1272,6 +1272,8 @@ timespec: TIME
|
||||
{ $$ = CMD_TIME_PIPELINE; }
|
||||
| TIME TIMEOPT
|
||||
{ $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
|
||||
| TIME TIMEOPT TIMEIGN
|
||||
{ $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
|
||||
;
|
||||
%%
|
||||
|
||||
@@ -2068,6 +2070,7 @@ STRING_INT_ALIST word_token_alist[] = {
|
||||
/* other tokens that can be returned by read_token() */
|
||||
STRING_INT_ALIST other_token_alist[] = {
|
||||
/* Multiple-character tokens with special values */
|
||||
{ "--", TIMEIGN },
|
||||
{ "-p", TIMEOPT },
|
||||
{ "&&", AND_AND },
|
||||
{ "||", OR_OR },
|
||||
@@ -2671,6 +2674,7 @@ time_command_acceptable ()
|
||||
case BANG: /* ! time pipeline */
|
||||
case TIME: /* time time pipeline */
|
||||
case TIMEOPT: /* time -p time pipeline */
|
||||
case TIMEIGN: /* time -p -- ... */
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -2697,6 +2701,7 @@ time_command_acceptable ()
|
||||
`}' is recognized if there is an unclosed `{' present.
|
||||
|
||||
`-p' is returned as TIMEOPT if the last read token was TIME.
|
||||
`--' is returned as TIMEIGN if the last read token was TIMEOPT.
|
||||
|
||||
']]' is returned as COND_END if the parser is currently parsing
|
||||
a conditional expression ((parser_state & PST_CONDEXPR) != 0)
|
||||
@@ -2782,6 +2787,9 @@ special_case_tokens (tokstr)
|
||||
/* Handle -p after `time'. */
|
||||
if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2])
|
||||
return (TIMEOPT);
|
||||
/* Handle -- after `time -p'. */
|
||||
if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2])
|
||||
return (TIMEIGN);
|
||||
#endif
|
||||
|
||||
#if defined (COND_COMMAND) /* [[ */
|
||||
@@ -3241,10 +3249,21 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
since they share the same defines. */
|
||||
if (flags & P_DOLBRACE)
|
||||
{
|
||||
if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 0)
|
||||
/* ${param%[%]word} */
|
||||
if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param#[#]word} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param/[/]pat/rep} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param^[^]pat} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param,[,]pat} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0)
|
||||
dolbrace_state = DOLBRACE_OP;
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0)
|
||||
@@ -4757,6 +4776,7 @@ reserved_word_acceptable (toksym)
|
||||
case THEN:
|
||||
case TIME:
|
||||
case TIMEOPT:
|
||||
case TIMEIGN:
|
||||
case COPROC:
|
||||
case UNTIL:
|
||||
case WHILE:
|
||||
|
||||
+5985
File diff suppressed because it is too large
Load Diff
+42
-35
@@ -1189,31 +1189,19 @@ simple_list1: simple_list1 AND_AND newline_list simple_list1
|
||||
;
|
||||
|
||||
pipeline_command: pipeline
|
||||
{ $$ = $1; }
|
||||
| BANG pipeline
|
||||
{ $$ = $1; }
|
||||
| BANG pipeline_command
|
||||
{
|
||||
if ($2)
|
||||
$2->flags |= CMD_INVERT_RETURN;
|
||||
$2->flags ^= CMD_INVERT_RETURN; /* toggle */
|
||||
$$ = $2;
|
||||
}
|
||||
| timespec pipeline
|
||||
| timespec pipeline_command
|
||||
{
|
||||
if ($2)
|
||||
$2->flags |= $1;
|
||||
$$ = $2;
|
||||
}
|
||||
| timespec BANG pipeline
|
||||
{
|
||||
if ($3)
|
||||
$3->flags |= $1|CMD_INVERT_RETURN;
|
||||
$$ = $3;
|
||||
}
|
||||
| BANG timespec pipeline
|
||||
{
|
||||
if ($3)
|
||||
$3->flags |= $2|CMD_INVERT_RETURN;
|
||||
$$ = $3;
|
||||
}
|
||||
| timespec list_terminator
|
||||
{
|
||||
ELEMENT x;
|
||||
@@ -1231,7 +1219,24 @@ pipeline_command: pipeline
|
||||
if ($2 == '\n')
|
||||
token_to_read = '\n';
|
||||
}
|
||||
|
||||
| BANG list_terminator
|
||||
{
|
||||
ELEMENT x;
|
||||
|
||||
/* This is just as unclean. Posix says that `!'
|
||||
by itself should be equivalent to `false'.
|
||||
We cheat and push a
|
||||
newline back if the list_terminator was a newline
|
||||
to avoid the double-newline problem (one to
|
||||
terminate this, one to terminate the command) */
|
||||
x.word = 0;
|
||||
x.redirect = 0;
|
||||
$$ = make_simple_command (x, (COMMAND *)NULL);
|
||||
$$->flags |= CMD_INVERT_RETURN;
|
||||
/* XXX - let's cheat and push a newline back */
|
||||
if ($2 == '\n')
|
||||
token_to_read = '\n';
|
||||
}
|
||||
;
|
||||
|
||||
pipeline: pipeline '|' newline_list pipeline
|
||||
@@ -2663,6 +2668,9 @@ time_command_acceptable ()
|
||||
case ELSE:
|
||||
case '{': /* } */
|
||||
case '(': /* ) */
|
||||
case BANG: /* ! time pipeline */
|
||||
case TIME: /* time time pipeline */
|
||||
case TIMEOPT: /* time -p time pipeline */
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -2776,13 +2784,6 @@ special_case_tokens (tokstr)
|
||||
return (TIMEOPT);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if defined (COMMAND_TIMING)
|
||||
if (STREQ (token, "time") && ((parser_state & PST_CASEPAT) == 0) && time_command_acceptable ())
|
||||
return (TIME);
|
||||
#endif /* COMMAND_TIMING */
|
||||
#endif
|
||||
|
||||
#if defined (COND_COMMAND) /* [[ */
|
||||
if ((parser_state & PST_CONDEXPR) && tokstr[0] == ']' && tokstr[1] == ']' && tokstr[2] == '\0')
|
||||
return (COND_END);
|
||||
@@ -3232,7 +3233,6 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
if MBTEST(ch == '\\') /* backslashes */
|
||||
tflags |= LEX_PASSNEXT;
|
||||
|
||||
#if 0 /* XXX - bash-4.2 */
|
||||
/* Based on which dolstate is currently in (param, op, or word),
|
||||
decide what the op is. We're really only concerned if it's % or
|
||||
#, so we can turn on a flag that says whether or not we should
|
||||
@@ -3241,26 +3241,34 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
since they share the same defines. */
|
||||
if (flags & P_DOLBRACE)
|
||||
{
|
||||
if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 0)
|
||||
/* ${param%[%]word} */
|
||||
if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param#[#]word} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param/[/]pat/rep} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param^[^]pat} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param,[,]pat} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0)
|
||||
dolbrace_state = DOLBRACE_OP;
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0)
|
||||
dolbrace_state = DOLBRACE_WORD;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0 /* XXX - bash-4.2 */
|
||||
/* The big hammer. Single quotes aren't special in double quotes. The
|
||||
problem is that Posix used to say the single quotes are semi-special:
|
||||
within a double-quoted ${...} construct "an even number of
|
||||
unescaped double-quotes or single-quotes, if any, shall occur." */
|
||||
/* This was changed in Interp 221 */
|
||||
if MBTEST(/*posixly_correct && shell_compatibility_level > 41 &&*/ dolbrace_state == DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
|
||||
/* This was changed in Austin Group Interp 221 */
|
||||
if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* Could also check open == '`' if we want to parse grouping constructs
|
||||
inside old-style command substitution. */
|
||||
@@ -3370,13 +3378,12 @@ parse_comsub (qc, open, close, lenp, flags)
|
||||
char *ret, *nestret, *ttrans, *heredelim;
|
||||
int retind, retsize, rflags, hdlen;
|
||||
|
||||
#if 0 /* XXX - bash-4.2 -- jwm@horde.net */
|
||||
/* Assume $(( introduces arithmetic command and parse accordingly. */
|
||||
/* Posix interp 217 says arithmetic expressions have precedence, so
|
||||
assume $(( introduces arithmetic expansion and parse accordingly. */
|
||||
peekc = shell_getc (0);
|
||||
shell_ungetc (peekc);
|
||||
if (peekc == '(')
|
||||
return (parse_matched_pair (qc, open, close, lenp, 0));
|
||||
#endif
|
||||
|
||||
/*itrace("parse_comsub: qc = `%c' open = %c close = %c", qc, open, close);*/
|
||||
count = 1;
|
||||
@@ -5220,7 +5227,7 @@ decode_prompt_string (string)
|
||||
{
|
||||
t = strrchr (t_string, '/');
|
||||
if (t)
|
||||
strcpy (t_string, t + 1);
|
||||
memmove (t_string, t + 1, strlen (t) - 1);
|
||||
}
|
||||
}
|
||||
#undef ROOT_PATH
|
||||
|
||||
@@ -336,7 +336,7 @@ static REDIRECTEE redir;
|
||||
third group are recognized only under special circumstances. */
|
||||
%token IF THEN ELSE ELIF FI CASE ESAC FOR SELECT WHILE UNTIL DO DONE FUNCTION COPROC
|
||||
%token COND_START COND_END COND_ERROR
|
||||
%token IN BANG TIME TIMEOPT
|
||||
%token IN BANG TIME TIMEOPT TIMEIGN
|
||||
|
||||
/* More general tokens. yylex () knows how to make these. */
|
||||
%token <word> WORD ASSIGNMENT_WORD REDIR_WORD
|
||||
@@ -1272,6 +1272,8 @@ timespec: TIME
|
||||
{ $$ = CMD_TIME_PIPELINE; }
|
||||
| TIME TIMEOPT
|
||||
{ $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
|
||||
| TIME TIMEOPT TIMEIGN
|
||||
{ $$ = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
|
||||
;
|
||||
%%
|
||||
|
||||
@@ -2068,6 +2070,7 @@ STRING_INT_ALIST word_token_alist[] = {
|
||||
/* other tokens that can be returned by read_token() */
|
||||
STRING_INT_ALIST other_token_alist[] = {
|
||||
/* Multiple-character tokens with special values */
|
||||
{ "--", TIMEIGN },
|
||||
{ "-p", TIMEOPT },
|
||||
{ "&&", AND_AND },
|
||||
{ "||", OR_OR },
|
||||
@@ -2513,6 +2516,7 @@ yylex ()
|
||||
if ((parser_state & PST_EOFTOKEN) && current_token == shell_eof_token)
|
||||
{
|
||||
current_token = yacc_EOF;
|
||||
itrace("read_token: read shell_eof_token, returning yacc_EOF");
|
||||
if (bash_input.type == st_string)
|
||||
rewind_input_string ();
|
||||
}
|
||||
@@ -2671,6 +2675,7 @@ time_command_acceptable ()
|
||||
case BANG: /* ! time pipeline */
|
||||
case TIME: /* time time pipeline */
|
||||
case TIMEOPT: /* time -p time pipeline */
|
||||
case TIMEIGN: /* time -p -- ... */
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -2697,6 +2702,7 @@ time_command_acceptable ()
|
||||
`}' is recognized if there is an unclosed `{' present.
|
||||
|
||||
`-p' is returned as TIMEOPT if the last read token was TIME.
|
||||
`--' is returned as TIMEIGN if the last read token was TIMEOPT.
|
||||
|
||||
']]' is returned as COND_END if the parser is currently parsing
|
||||
a conditional expression ((parser_state & PST_CONDEXPR) != 0)
|
||||
@@ -2782,6 +2788,9 @@ special_case_tokens (tokstr)
|
||||
/* Handle -p after `time'. */
|
||||
if (last_read_token == TIME && tokstr[0] == '-' && tokstr[1] == 'p' && !tokstr[2])
|
||||
return (TIMEOPT);
|
||||
/* Handle -- after `time -p'. */
|
||||
if (last_read_token == TIMEOPT && tokstr[0] == '-' && tokstr[1] == '-' && !tokstr[2])
|
||||
return (TIMEIGN);
|
||||
#endif
|
||||
|
||||
#if defined (COND_COMMAND) /* [[ */
|
||||
@@ -3241,10 +3250,21 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
since they share the same defines. */
|
||||
if (flags & P_DOLBRACE)
|
||||
{
|
||||
if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 0)
|
||||
/* ${param%[%]word} */
|
||||
if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '%' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param#[#]word} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '#' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param/[/]pat/rep} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param^[^]pat} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
/* ${param,[,]pat} */
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == ',' && retind > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", ch) != 0)
|
||||
dolbrace_state = DOLBRACE_OP;
|
||||
else if MBTEST(dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", ch) == 0)
|
||||
@@ -3256,7 +3276,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
within a double-quoted ${...} construct "an even number of
|
||||
unescaped double-quotes or single-quotes, if any, shall occur." */
|
||||
/* This was changed in Austin Group Interp 221 */
|
||||
if MBTEST(posixly_correct && /*shell_compatibility_level > 41 &&*/ dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
|
||||
if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
|
||||
continue;
|
||||
|
||||
/* Could also check open == '`' if we want to parse grouping constructs
|
||||
@@ -4721,6 +4741,9 @@ got_token:
|
||||
break;
|
||||
}
|
||||
|
||||
if (result == WORD)
|
||||
itrace("read_token: returning WORD: `%s'", yylval.word->word);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -4757,6 +4780,7 @@ reserved_word_acceptable (toksym)
|
||||
case THEN:
|
||||
case TIME:
|
||||
case TIMEOPT:
|
||||
case TIMEIGN:
|
||||
case COPROC:
|
||||
case UNTIL:
|
||||
case WHILE:
|
||||
|
||||
+576
-1
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: bash 4.1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-12-30 08:25-0500\n"
|
||||
"PO-Revision-Date: 2010-06-13 14:31+0800\n"
|
||||
"PO-Revision-Date: 2010-06-24 16:27+0800\n"
|
||||
"Last-Translator: Alyex.ye <alyex.ye@gmail.com>\n"
|
||||
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -2284,6 +2284,21 @@ msgid ""
|
||||
" alias returns true unless a NAME is supplied for which no alias has been\n"
|
||||
" defined."
|
||||
msgstr ""
|
||||
"定义或显示别名。\n"
|
||||
" \n"
|
||||
" 不带参数时, `alias' 以可重用的格式\n"
|
||||
" `alias 名称=值'在标准输出设备上打印别名列表。\n"
|
||||
" \n"
|
||||
" 否则,对于每个给定值的名称定义一个别名。\n"
|
||||
" 值末尾的空格会使下一个词被检测\n"
|
||||
" 作为别名替换展开。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -p\t以可重用的格式打印所有的已定义的别名\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 除非一个没有定义的名字被作为参数提供,否则 alias \n"
|
||||
" 返回值为真。"
|
||||
|
||||
#: builtins.c:276
|
||||
msgid ""
|
||||
@@ -2335,6 +2350,37 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" bind returns 0 unless an unrecognized option is given or an error occurs."
|
||||
msgstr ""
|
||||
"设定行读取键绑定和变量。\n"
|
||||
" \n"
|
||||
" 绑定一个键序列到一个行读取函数或者宏,或者设定一个\n"
|
||||
" 行读取变量。非选项参数的语法和 ~/.inputrc 文件中的等\n"
|
||||
" 同,但是必须作为一个参数被传递,\n"
|
||||
" 例如,bind '\"\\C-x\\C-r\": re-read-init-file'.\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -m 键映射 在此命令执行过程中使用指定的键映射。\n"
|
||||
" 可以被接受的键映射名字有 emacs、\n"
|
||||
" emacs-standard、emacs-meta、emacs-ctlx、vi、\n"
|
||||
" vi-move、vi-command、和 vi-insert。\n"
|
||||
" -l 列出函数名称。\n"
|
||||
" -P 列出函数名称和绑定。\n"
|
||||
" -p 以可以重新用作输入的格式列出函数名称和\n"
|
||||
" 绑定。\n"
|
||||
" -S 列出可以启动宏的键序列以及它们的值\n"
|
||||
" -s 以可以重新用作输入的格式列出可以启动宏\n"
|
||||
" 的键以及它们的值。\n"
|
||||
" -V 列出变量名成和它们的值\n"
|
||||
" -v 以可以重新用作输入的格式列出变量的名称\n"
|
||||
" 和它们的值\n"
|
||||
" -q 函数名 查询指定的函数可以由哪些键启动。\n"
|
||||
" -u 函数名 反绑定所有绑定至指定函数的键。\n"
|
||||
" -r 键序列 取消指定键序列的绑定。\n"
|
||||
" -f 文件名 从指定文件中读取键绑定。\n"
|
||||
" -x 键序列:shell命令\t当指定的键序列被输入时,执行\n"
|
||||
" \t\t\t\t指定的shell命令\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 除非使用了无法辨认的选项或者错误发生,否则返回0."
|
||||
|
||||
#: builtins.c:326
|
||||
msgid ""
|
||||
@@ -2346,6 +2392,13 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" The exit status is 0 unless N is not greater than or equal to 1."
|
||||
msgstr ""
|
||||
"退出 for、while、或 until 循环\n"
|
||||
" \n"
|
||||
" 退出一个 FOR、WHILE 或 UNTIL 循环。如果指定了N,则打破N重\n"
|
||||
" 循环\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 退出状态为0除非 N 不大于或等于 1。"
|
||||
|
||||
#: builtins.c:338
|
||||
msgid ""
|
||||
@@ -2357,6 +2410,13 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" The exit status is 0 unless N is not greater than or equal to 1."
|
||||
msgstr ""
|
||||
"继续 for、while、或 until 循环。\n"
|
||||
" \n"
|
||||
" 继续当前 FOR、WHILE 或 UNTIL 循环的下一步。\n"
|
||||
" 如果指定了 N, 则继续当前的第 N 重循环。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 退出状态为 0 除非 N 不大于或等于1。"
|
||||
|
||||
#: builtins.c:350
|
||||
msgid ""
|
||||
@@ -2370,6 +2430,15 @@ msgid ""
|
||||
" Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is\n"
|
||||
" not a shell builtin.."
|
||||
msgstr ""
|
||||
"执行 shell 内嵌。\n"
|
||||
" \n"
|
||||
" 带参数 ARGs 执行 SHELL-BUILTIN 内嵌,并且不做命令查询\n"
|
||||
" 在希望以 shell 函数的形式来重新实现 shell 内嵌,\n"
|
||||
" 并且希望在函数之内执行该 shell 内嵌的情况下有用处。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 以 SHELL-BUILTIN 内嵌的退出状态为准,或者如果 SHELL-BUILTIN不是一个 shell 内嵌时\n"
|
||||
" 为假。."
|
||||
|
||||
#: builtins.c:365
|
||||
msgid ""
|
||||
@@ -2386,6 +2455,18 @@ msgid ""
|
||||
" Returns 0 unless the shell is not executing a shell function or EXPR\n"
|
||||
" is invalid."
|
||||
msgstr ""
|
||||
"返回当前子调用的上下文。\n"
|
||||
" \n"
|
||||
" 不带有 EXPR 时,返回 \"$line $filename\"。带有 EXPR 时,返回\n"
|
||||
" \"$line $subroutine $filename\";这个额外的信息可以被用于提供\n"
|
||||
" 栈追踪。\n"
|
||||
" \n"
|
||||
" EXPR 的值 显示了到当前调用帧需要回去多少个调用帧;顶部帧\n"
|
||||
" 是第 0 帧。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 除非 shell 不在执行一个 shell 函数或者 EXPR 无效,否则返回结\n"
|
||||
" 果为0。"
|
||||
|
||||
#: builtins.c:383
|
||||
msgid ""
|
||||
@@ -2413,6 +2494,29 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns 0 if the directory is changed; non-zero otherwise."
|
||||
msgstr ""
|
||||
"改变 shell 工作目录。\n"
|
||||
" \n"
|
||||
" 改变当前目录至 DIR 目录。默认的 DIR 目录是 shell 变量 HOME\n"
|
||||
" 的值。\n"
|
||||
" \n"
|
||||
" 变量 CDPATH 定义了含有 DIR 的目录的搜索路径。\n"
|
||||
" CDPATH 变量中不同的目录名称由分号(:)分隔。\n"
|
||||
" 一个空的目录名称和当前目录是一样的。如果 DIR 变量由\n"
|
||||
" 斜杠 (/) 打头,则 CDPATH 变量不会被使用。\n"
|
||||
" \n"
|
||||
" 如果路径找不到,并且 shell 选项`cdable_vars' 被设定,\n"
|
||||
" 则参数词被假定为一个变量名。如果该变量有值,则它的值\n"
|
||||
" 被当作 DIR 目录。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -L\t强制跟随符号链接。\n"
|
||||
" -P\t使用物理目录结构而不跟随符号链接\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" 默认情况下跟随符号链接,如同指定 `-L'。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 如果目录改变则返回0,否则非零。"
|
||||
|
||||
#: builtins.c:411
|
||||
msgid ""
|
||||
@@ -2429,6 +2533,18 @@ msgid ""
|
||||
" Returns 0 unless an invalid option is given or the current directory\n"
|
||||
" cannot be read."
|
||||
msgstr ""
|
||||
"打印当前工作目录的名字。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -L\t打印 $PWD 变量的值,如果它命名了当前的\n"
|
||||
" \t工作目录\n"
|
||||
" -P\t打印当前的物理路径,不带有任何的符号链接\n"
|
||||
" \n"
|
||||
" 默认情况下,`pwd' 的行为和带 `-L' 选项一致\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 除非使用了无效选项或者当前目录不可读,否则\n"
|
||||
" 返回状态为0。"
|
||||
|
||||
#: builtins.c:428
|
||||
msgid ""
|
||||
@@ -2487,6 +2603,20 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns exit status of COMMAND, or failure if COMMAND is not found."
|
||||
msgstr ""
|
||||
"执行一个简单命令或者显示命令的相关信息。\n"
|
||||
" \n"
|
||||
" 带 ARGS 参数运行 COMMAND 命令且抑制 shell 函数查询,或显示\n"
|
||||
" 指定的 COMMAND 命令的信息。可以在存在相同名称的函数定义的\n"
|
||||
" 情况下被用于启动磁盘上的命令。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -p\t使用 PATH 变量的一个默认值以确保所有的标准工具\n"
|
||||
" \t都能被找到。\n"
|
||||
" -v\t打印 COMMAND 命令的描述,和 `type' 内嵌相似\n"
|
||||
" -V\t打印每个 COMMAND 命令的详细描述\n"
|
||||
" \n"
|
||||
" 退出状态\n"
|
||||
" 返回 COMMAND 命令的返回状态,或者当找不到 COMMAND 命令时失败。"
|
||||
|
||||
#: builtins.c:476
|
||||
msgid ""
|
||||
@@ -2522,6 +2652,37 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless an invalid option is supplied or an error occurs."
|
||||
msgstr ""
|
||||
"设定变量值和属性。\n"
|
||||
" \n"
|
||||
" 声明变量并且赋予它们属性。如果没用给定名称,\n"
|
||||
" 则显示所有变量的属性和值。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -f\t限制动作或显示函数名称和定义\n"
|
||||
" -F\t限制仅显示函数名称(以及行号和调试时\n"
|
||||
" \t源文件名)\n"
|
||||
" -p\t显示每个 NAME 变量的属性和值\n"
|
||||
" \n"
|
||||
" 设定属性的选项:\n"
|
||||
" -a\t使 NAME 成为下标数组(如果支持)\n"
|
||||
" -A\t使 NAME 成为关联数组 (如果支持)\n"
|
||||
" -i\t使 NAME 带有 `integer' (整数)属性\n"
|
||||
" -l\t将 NAME 在赋值时转为小写\n"
|
||||
" -r\t将 NAME 变为只读\n"
|
||||
" -t\t使 NAME 带有 `trace' (追踪)属性\n"
|
||||
" -u\t将 NAME 在赋值时转为大写\n"
|
||||
" -x\t将 NAME 导出\n"
|
||||
" \n"
|
||||
" 用 `+' 代替 `-' 会关闭指定选项。\n"
|
||||
" \n"
|
||||
" 带有整数属性的变量在赋值时将使用算术估值(见\n"
|
||||
" `let' 命令)\n"
|
||||
" \n"
|
||||
" 在函数中使用时,`declare' 使 NAME 成为本地变量,和 `local'\n"
|
||||
" 命令一致。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功除非使用了无效选项或者发生错误。"
|
||||
|
||||
#: builtins.c:512
|
||||
msgid ""
|
||||
@@ -2547,6 +2708,17 @@ msgid ""
|
||||
" Returns success unless an invalid option is supplied, an error occurs,\n"
|
||||
" or the shell is not executing a function."
|
||||
msgstr ""
|
||||
"定义本地变量。\n"
|
||||
" \n"
|
||||
" 创建一个以 NAME 为名称的变量,并且将 VALUE 赋值给它。\n"
|
||||
" OPTION 选项可以是任何能被 `declare' 接受的选项。\n"
|
||||
" \n"
|
||||
" 本地变量只能在函数内部被使用,它们只能在定义它们的函数内\n"
|
||||
" 部以及子函数中可见。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功除非使用了无效的选项、发生了错误或者 shell 不在\n"
|
||||
" 执行一个函数。"
|
||||
|
||||
#: builtins.c:537
|
||||
msgid ""
|
||||
@@ -2578,6 +2750,33 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless a write error occurs."
|
||||
msgstr ""
|
||||
"将参数写到标准输出。\n"
|
||||
" \n"
|
||||
" 在标准输出上显示 ARG 参数后跟一个换行。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -n\t不要追加换行\n"
|
||||
" -e\t启用下列反斜杠转义的解释\n"
|
||||
" -E\t显式地抑制对于反斜杠转义的解释\n"
|
||||
" \n"
|
||||
" `echo' 对下列反斜杠字符进行转义:\n"
|
||||
" \\a\t警告(响铃)\n"
|
||||
" \\b\t退格\n"
|
||||
" \\c\t抑制更多的输出\n"
|
||||
" \\e\t转义字符\n"
|
||||
" \\f\t格式提供\n"
|
||||
" \\n\t换行\n"
|
||||
" \\r\t回车\n"
|
||||
" \\t\t横向制表符\n"
|
||||
" \\v\t纵向制表符\n"
|
||||
" \\\\\t反斜杠\n"
|
||||
" \\0nnn\t以 NNN (八进制)为 ASCII 码的字符。 NNN 可以是\n"
|
||||
" \t0到3个八进制数字\n"
|
||||
" \\xHH\t以 HH (十六进制)为值的八比特字符。HH可以是\n"
|
||||
" \t一个或两个十六进制数字\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功除非有写错误发生。"
|
||||
|
||||
#: builtins.c:571
|
||||
msgid ""
|
||||
@@ -2591,6 +2790,15 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless a write error occurs."
|
||||
msgstr ""
|
||||
"写参数至标准输出设备。\n"
|
||||
" \n"
|
||||
" 在标准输出设备上显示 ARGs 参数和一个换行。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -n\t不附加换行\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 除非写错误发生,否则返回成功。"
|
||||
|
||||
#: builtins.c:586
|
||||
msgid ""
|
||||
@@ -2618,6 +2826,29 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless NAME is not a shell builtin or an error occurs."
|
||||
msgstr ""
|
||||
"启用和禁用 shell 内嵌。\n"
|
||||
" \n"
|
||||
" 启用和禁用 shell 的内嵌命令。禁用使您能够执行一个和内嵌\n"
|
||||
" 命令同名的磁盘上的命令,而无须使用完整的路径名。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -a\t打印一个内嵌的列表,并显示其中每一个是否启用\n"
|
||||
" -n\t禁用每一个 NAME 内嵌或者显示一个被禁用的内嵌的列表\n"
|
||||
" -p\t以可重用的格式打印一个内嵌的列表\n"
|
||||
" -s\t仅打印Posix `special' 内嵌的名称\n"
|
||||
" \n"
|
||||
" 控制动态加载的选项:\n"
|
||||
" -f\t从共享对象 FILENAME 文件中加载 NAME 内嵌\n"
|
||||
" -d\t删除以 -f 选项加载的内嵌\n"
|
||||
" \n"
|
||||
" 不带选项时,每一个 NAME 内嵌都被启用。\n"
|
||||
" \n"
|
||||
" 如果要使用 $PATH 中找到的 `test' 而不是 shell 内嵌的版本,\n"
|
||||
" 输入 `enable -n test'。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功,除非 NAME 不是一个 shell 内嵌或者有错误发生。"
|
||||
|
||||
#: builtins.c:614
|
||||
msgid ""
|
||||
@@ -2629,6 +2860,13 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns exit status of command or success if command is null."
|
||||
msgstr ""
|
||||
"将参数作为 shell 命令执行。\n"
|
||||
" \n"
|
||||
" 将 ARGs 合成一个字符串,用结果作为 shell 的输入,\n"
|
||||
" 并且执行得到的命令。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 以命令的状态退出,或者在命令为空的情况下返回成功。"
|
||||
|
||||
#: builtins.c:626
|
||||
msgid ""
|
||||
@@ -2670,6 +2908,43 @@ msgid ""
|
||||
" Returns success if an option is found; fails if the end of options is\n"
|
||||
" encountered or an error occurs."
|
||||
msgstr ""
|
||||
"解析选项参数。\n"
|
||||
" \n"
|
||||
" Getopts 被 shell 过程用于解析可定位的参数作为选项。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" OPTSTRING 字符串包含待识别的选项字母;如果一个字母后面跟\n"
|
||||
" 着分号,则该选项期待一个参数,而该参数应用空格与选项分开。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" 每次启动时,getopts 会将下一个选项放到 shell 变量 $name\n"
|
||||
" 中,如果 name 变量不存在则先将其初始化,而下一个待处\n"
|
||||
" 理的参数序号放入 shell 变量 OPTIND 中。OPTIND 变量在每\n"
|
||||
" 次 shell 或者 shell 脚本启动时都被初始化为1。当一个选项要\n"
|
||||
" 求有一个参数时,getopts 将参数放入 shell 变量 OPTARG\n"
|
||||
" 中。\n"
|
||||
" \n"
|
||||
" getopts 有两种报告错误的方法。如果 OPTSTRING 变量的第\n"
|
||||
" 一个字符是冒号,getopts 使用沉默错误报告。在这种模式\n"
|
||||
" 下,不会打印错误消息。如果看到了一个无效的选项,\n"
|
||||
" getopts 将找到的选项字符放至 OPTARG 变量中。如果一个必\n"
|
||||
" 须的选项没有找到,getopts 放一个 ':' 到 NAME 变量中并且设\n"
|
||||
" 置 OPTARG 变量为找到的选项字符。如果 getopts 不在沉默模\n"
|
||||
" 式中,并且遇到了一个无效的选项,getopts 放置一个 '?' 到 NAME \n"
|
||||
" 变量中并且反设定 OPTARG变量。如果必须的选项没有找到,\n"
|
||||
" 一个'?'会被放入 NAME变量中,OPTARG 将被反设定,并且会\n"
|
||||
" 打印一个诊断信息。\n"
|
||||
" \n"
|
||||
" 如果 shell 变量 OPTERR 的值为0,getopts 禁用\n"
|
||||
" 错误信息的打印,即使 OPTSTRING 变量的第一个字符不是一\n"
|
||||
" 个冒号。OPTERR 的默认值为1.\n"
|
||||
" \n"
|
||||
" Getopts 通常解析可定位的参数($0 - $9),不过如果提供了\n"
|
||||
" 更多的参数,它们反而会被解析。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 如果一个选项被找到则返回成功;如果遇到了选项的结尾或者\n"
|
||||
" 有错误发生则返回失败。"
|
||||
|
||||
#: builtins.c:668
|
||||
msgid ""
|
||||
@@ -2690,6 +2965,22 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless COMMAND is not found or a redirection error occurs."
|
||||
msgstr ""
|
||||
"使用指定命令替换 shell。\n"
|
||||
" \n"
|
||||
" 执行 COMMAND 命令,以指定的程序替换这个 shell。\n"
|
||||
" ARGUMENTS 参数成为 COMMAND命令的参数。如果\n"
|
||||
" 没有指定COMMAND 命令,则任何的重定向在当前 shell 中生效。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -a 名称\t作为第0个参数传递给 COMMAND 命令\n"
|
||||
" -c\t\t在一个空环境中执行 COMMAND 命令\n"
|
||||
" -l\t\t在COMMAND 命令的第0个参数中加一个短线\n"
|
||||
" \n"
|
||||
" 如果命令不能被执行,则退出一个非交互式的 shell,除非\n"
|
||||
" shell 选项`execfail' 已经设定。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功除非 COMMAND 命令没有找到或者出现一个重定向错误。"
|
||||
|
||||
#: builtins.c:689
|
||||
msgid ""
|
||||
@@ -2741,6 +3032,29 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success or status of executed command; non-zero if an error occurs."
|
||||
msgstr ""
|
||||
"从历史列表中显示或者执行命令。\n"
|
||||
" \n"
|
||||
" fc 被用于从历史列表中列出或者重新编辑并执行命令。\n"
|
||||
" FIRST 和 LAST 变量可以是数字用于指定范围,或者 FIRST 可以是\n"
|
||||
" 字符串,意味着以这个字符串打头的最近的一个命令。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -e ENAME\t选择使用哪个编辑器。默认的是 FCEDIT, 然后是 EDITOR,\n"
|
||||
" \t\t然后是 vi\n"
|
||||
" -l \t列出行而不编辑\n"
|
||||
" -n\t列举时省略行号\n"
|
||||
" -r\t反转行的顺序(最新行在前)\n"
|
||||
" \n"
|
||||
" 用 `fc -s [模式=替换 ...] [命令]' 的格式,COMMAND 命令会在 OLD=NEW\n"
|
||||
" 替换之后被重新执行。\n"
|
||||
" \n"
|
||||
" r='fc -s' 是一个有用的别名,这样的话输入 `r cc'会执行最后一个以 `cc'\n"
|
||||
" 开头的命令,输入 `r'会重新执行最后一个命令。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功,或者执行的命令的状态;如果错误发生则返回非零。"
|
||||
|
||||
#: builtins.c:738
|
||||
msgid ""
|
||||
@@ -2753,6 +3067,14 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Status of command placed in foreground, or failure if an error occurs."
|
||||
msgstr ""
|
||||
"将任务移至前台。\n"
|
||||
" \n"
|
||||
" 将以 JOB_SPEC 标识的任务放至前台,使其成为\n"
|
||||
" 当前任务。如果 JOB_SPEC 不存在,shell 观念中的当前任务 \n"
|
||||
" 将被使用。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 放至前台的命令状态,或者当错误发生时为失败。"
|
||||
|
||||
#: builtins.c:753
|
||||
msgid ""
|
||||
@@ -2765,6 +3087,14 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless job control is not enabled or an error occurs."
|
||||
msgstr ""
|
||||
"移动任务至后台。\n"
|
||||
" \n"
|
||||
" 将 JOB_SPEC 标识的任务放至后台,就像它们\n"
|
||||
" 是带 `&' 启动的一样。如果 JOB_SPEC 不存在,shell 观念中的\n"
|
||||
" 当前任务将会被使用。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功除非任务管理没有启用或者错误发生。"
|
||||
|
||||
#: builtins.c:767
|
||||
msgid ""
|
||||
@@ -2788,6 +3118,25 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless NAME is not found or an invalid option is given."
|
||||
msgstr ""
|
||||
"记住或显示程序位置。\n"
|
||||
" \n"
|
||||
" 确定并记住每一个给定 NAME 名称的命令的完整路径。如果\n"
|
||||
" 不提供参数,则显示已经记住的命令的信息。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -d\t\t忘记每一个已经记住的命令的位置\n"
|
||||
" -l\t\t以可作为输入重用的格式显示\n"
|
||||
" -p pathname\t使用 pathname 路径作为 NAME 命令的全路径\n"
|
||||
" -r\t\t忘记所有记住的位置\n"
|
||||
" -t\t\t打印记住的每一个 NAME 名称的位置,如果指定了多个\n"
|
||||
" \t\tNAME 名称,则每个位置前面会加上相应的 NAME 名称\n"
|
||||
" \t\t\n"
|
||||
" 参数:\n"
|
||||
" NAME\t\t每个 NAME 名称会在 $PATH 路径变量中被搜索,并\n"
|
||||
" \t\t且添加到记住的命令的列表中。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功,除非 NAME 命令没有找到或者使用了无效的选项。"
|
||||
|
||||
#: builtins.c:792
|
||||
msgid ""
|
||||
@@ -2809,6 +3158,23 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless PATTERN is not found or an invalid option is given."
|
||||
msgstr ""
|
||||
"显示内嵌命令的相关信息。\n"
|
||||
" \n"
|
||||
" 显示内嵌命令的简略信息。如果指定了 PATTERN 模式,\n"
|
||||
" 给出所有匹配 PATTERN 模式的命令的详细帮助,否则打\n"
|
||||
" 印一个帮助主题列表\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -d\t输出每个主题的简短描述\n"
|
||||
" -m\t以伪 man 手册的格式显示使用方法\n"
|
||||
" -s\t为每一个匹配 PATTERN 模式的主题仅显示一个用法\n"
|
||||
" \t简介\n"
|
||||
" \n"
|
||||
" 参数:\n"
|
||||
" PATTERN\tPattern 模式指定一个帮助主题\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功,除非 PATTERN 模式没有找到或者使用了无效选项。"
|
||||
|
||||
#: builtins.c:816
|
||||
msgid ""
|
||||
@@ -2842,6 +3208,35 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless an invalid option is given or an error occurs."
|
||||
msgstr ""
|
||||
"显示或操纵历史列表。\n"
|
||||
" \n"
|
||||
" 带行号显示历史列表,将每个被修改的条目加上前缀 `*'。\n"
|
||||
" 参数 N 会仅列出最后的 N 个条目。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -c\t删除所有条目从而清空历史列表。\n"
|
||||
" -d 偏移量\t从指定位置删除历史列表。\n"
|
||||
" \n"
|
||||
" -a\t将当前绘画的历史行追加到历史文件中\n"
|
||||
" -n\t从历史文件中读取所有未被读取的行\n"
|
||||
" -r\t读取历史文件并将内容追加到历史列表中\n"
|
||||
" \t中\n"
|
||||
" -w\t将当前历史写入到历史文件中\n"
|
||||
" \t并追加到历史列表中\n"
|
||||
" \n"
|
||||
" -p\t对每一个 ARG 参数展开历史并显示结果\n"
|
||||
" \t而不存储到历史列表中\n"
|
||||
" -s\t以单条记录追加 ARG 到历史列表中\n"
|
||||
" \n"
|
||||
" 如果给定了 FILENAME 文件名,则它将被作为历史文件。否则\n"
|
||||
" 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.bash_history 文件。\n"
|
||||
" \n"
|
||||
" 如果 $HISTTIMEFORMAT 变量被设定并且不为空,它的值会被用于\n"
|
||||
" strftime(3) 的格式字符串来打印与每一个显示的历史条目想关联的时\n"
|
||||
" 间戳,否则不打印时间戳。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功,除非使用了无效的选项或者发生错误。"
|
||||
|
||||
#: builtins.c:852
|
||||
msgid ""
|
||||
@@ -2866,6 +3261,24 @@ msgid ""
|
||||
" Returns success unless an invalid option is given or an error occurs.\n"
|
||||
" If -x is used, returns the exit status of COMMAND."
|
||||
msgstr ""
|
||||
"显示任务状态。\n"
|
||||
" \n"
|
||||
" 列出活动的任务。JPBSPEC 限制仅输出指定的任务。\n"
|
||||
" 不带选项时,所有活动任务的状态都会显示。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -l\t在正常信息基础上列出进程号\n"
|
||||
" -n\t列出上次通告之后改变了状态的进程\n"
|
||||
" -p\t仅列出进程号\n"
|
||||
" -r\t限制仅输出运行中的任务\n"
|
||||
" -s\t限制仅输出停止的任务\n"
|
||||
" \n"
|
||||
" 如果使用了 -x 选项,ARG 参数中的所有任务申明会被替换为该任务\n"
|
||||
" 的进程组头领的进程号,然后执行 COMMAND 命令。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功,除非使用了无效的选项或者有错误发生。\n"
|
||||
" 如果使用 -x选项,则返回 COMMAND 命令的退出状态。"
|
||||
|
||||
#: builtins.c:879
|
||||
msgid ""
|
||||
@@ -2883,6 +3296,19 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless an invalid option or JOBSPEC is given."
|
||||
msgstr ""
|
||||
"从当前 shell 中删除任务。\n"
|
||||
" \n"
|
||||
" 从活动任务表中删除每一个 JOBSPEC 参数。不带任何\n"
|
||||
" JOBSPEC 参数时,shell 使用观念中的当前任务。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -a\t如果不提供 JOBSPEC 参数,则删除所有任务\n"
|
||||
" -h\t标识每个 JOBSPEC 任务,从而当 shell 接收到 SIGHUP\n"
|
||||
" \t信号时不发送 SIGHUP 给指定任务\n"
|
||||
" -r\t仅删除运行中的任务\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功除非使用了无效的选项或者 JOBSPEC 申明。"
|
||||
|
||||
#: builtins.c:898
|
||||
msgid ""
|
||||
@@ -2949,6 +3375,46 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise.."
|
||||
msgstr ""
|
||||
"估值算数表达式。\n"
|
||||
" \n"
|
||||
" 将每个 ARG 参赛作为算数表达式来估值。估值的计算以等宽的整\n"
|
||||
" 数完成,不带溢出检测,不过除 0 是被置陷阱的并且会报一个错\n"
|
||||
" 误。下列操作符被按照相同的算数优先级组合。列表的顺序按照\n"
|
||||
" 优先级从高至低。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" \tid++, id--\t变量后置加,后置减\n"
|
||||
" \t++id, --id\t变量前置加,前置减\n"
|
||||
" \t-, +\t\t一元减法,一元加法\n"
|
||||
" \t!, ~\t\t逻辑和比特取反\n"
|
||||
" \t**\t\t指数\n"
|
||||
" \t*, /, %\t\t乘法,除法,取余数\n"
|
||||
" \t+, -\t\t增加,减少\n"
|
||||
" \t<<, >>\t\t向左和向右比特移位\n"
|
||||
" \t<=, >=, <, >\t比较\n"
|
||||
" \t==, !=\t\t等于,不等于\n"
|
||||
" \t&\t\t比特与\n"
|
||||
" \t^\t\t比特异或\n"
|
||||
" \t|\t\t比特或\n"
|
||||
" \t&&\t\t逻辑与\n"
|
||||
" \t||\t\t逻辑或\n"
|
||||
" \texpr ? expr : expr\n"
|
||||
" \t\t\t条件操作符\n"
|
||||
" \t=, *=, /=, %=,\n"
|
||||
" \t+=, -=, <<=, >>=,\n"
|
||||
" \t&=, ^=, |=\t赋值\n"
|
||||
" \n"
|
||||
" Shell 变量允许作为操作数。表达式中的变量的名称会被取代\n"
|
||||
" 以值(强制转换为等宽的整数)。表达式中的变量不需要打开\n"
|
||||
" 整数属性。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" 操作符按照优先级进行估值。括号中的子表达式将被先估值,\n"
|
||||
" 并有可能重载上述的表达式规则。\n"
|
||||
" \n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 如果最后一个 ARG 参数估值为0,则 let 返回1; 否则 let 返回0。"
|
||||
|
||||
#: builtins.c:966
|
||||
msgid ""
|
||||
@@ -3003,6 +3469,14 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns N, or failure if the shell is not executing a function or script."
|
||||
msgstr ""
|
||||
"从一个 shell 函数返回。\n"
|
||||
" \n"
|
||||
" 使一个函数或者被引用的脚本以指定的返回值 N 退出。\n"
|
||||
" 如果 N 被省略,则返回状态就是\n"
|
||||
" 函数或脚本中的最后一个执行的命令的状态。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回 N,或者如果 shell 不在执行一个函数或引用脚本时,失败。"
|
||||
|
||||
#: builtins.c:1022
|
||||
msgid ""
|
||||
@@ -3434,6 +3908,15 @@ msgid ""
|
||||
" Returns the status of ID; fails if ID is invalid or an invalid option is\n"
|
||||
" given."
|
||||
msgstr ""
|
||||
"等待进程完成并且返回退出状态。\n"
|
||||
" \n"
|
||||
" 等待指定进程并报告它的终止状态。如果\n"
|
||||
" 没有提供PID,则当前所有的活跃子进程都会被等待,\n"
|
||||
" 并且返回码为零。PID必须为进程号。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回进程ID的状态;如果ID是无效的进程号或者指定了无效\n"
|
||||
" 的选项则失败。"
|
||||
|
||||
#: builtins.c:1481
|
||||
msgid ""
|
||||
@@ -3500,6 +3983,18 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" The return status is the return status of PIPELINE."
|
||||
msgstr ""
|
||||
"报告管道执行的消耗时间。\n"
|
||||
" \n"
|
||||
" 执行 PIPELINE 并且打印 PIPELINE 终结时实际时间、用户 CPU 时间和系统\n"
|
||||
" CPU 时间的总结。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -p\t用可迁移的 POSIX 格式打印用时总结。\n"
|
||||
" \n"
|
||||
" TIMEFORMAT 变量的值被作为输出格式。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回状态即PIPELINE 的返回状态。"
|
||||
|
||||
#: builtins.c:1551
|
||||
msgid ""
|
||||
@@ -3511,6 +4006,13 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns the status of the last command executed."
|
||||
msgstr ""
|
||||
"基于模式匹配来执行命令。\n"
|
||||
" \n"
|
||||
" 基于 PATTERN 模式匹配的词 WORD,有选择的执行 COMMANDS 命令。\n"
|
||||
" `|' 用于分隔多个模式。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回最后一个执行的命令的状态。"
|
||||
|
||||
#: builtins.c:1563
|
||||
msgid ""
|
||||
@@ -3538,6 +4040,13 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns the status of the last command executed."
|
||||
msgstr ""
|
||||
"只要测试成功即执行命令。\n"
|
||||
" \n"
|
||||
" 只要在 `while' COMMANDS 中的最终命令返回结果为0,则\n"
|
||||
" 展开并执行 COMMANDS 命令。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回最后一个执行的命令的状态。"
|
||||
|
||||
#: builtins.c:1592
|
||||
msgid ""
|
||||
@@ -3549,6 +4058,13 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns the status of the last command executed."
|
||||
msgstr ""
|
||||
"当测试不同过时执行命令。\n"
|
||||
" \n"
|
||||
" `until' COMMANDS 命令的最终命令返回状态不为 0 时,\n"
|
||||
" 展开并执行 COMMANDS 命令。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回最后一个执行的命令的状态。"
|
||||
|
||||
#: builtins.c:1604
|
||||
msgid ""
|
||||
@@ -3562,6 +4078,15 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns the exit status of COMMAND."
|
||||
msgstr ""
|
||||
"创建一个以 NAME 为名的副进程。\n"
|
||||
" \n"
|
||||
" 异步执行 COMMANDS 命令,在执行 shell 中的数组变量 NAME\n"
|
||||
" 的 0 号和 1 号元素作为文件描述符,以一个管道连接命令\n"
|
||||
" 分别作为命令的标准输出和输入设备。\n"
|
||||
" 默认的 NAME 是 \"COPROC\"。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回 COMMAND 命令的退出状态。"
|
||||
|
||||
#: builtins.c:1618
|
||||
msgid ""
|
||||
@@ -3575,6 +4100,15 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless NAME is readonly."
|
||||
msgstr ""
|
||||
"定义 shell 函数。\n"
|
||||
" \n"
|
||||
" 创建一个以 NAME 为名的 shell 函数。当作为一个简单的命令启用时,\n"
|
||||
" NAME 函数执行调用 shell 的上下文中的 COMMANDs 命令。当 NAME\n"
|
||||
" 被启用时,参数作为 $1...$n 被传递给函数,函数的名字储存在变量\n"
|
||||
" $FUNCNAME 中。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回成功除非 NAME 为只读。"
|
||||
|
||||
#: builtins.c:1632
|
||||
msgid ""
|
||||
@@ -3586,6 +4120,13 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns the status of the last command executed."
|
||||
msgstr ""
|
||||
"将命令组合为一个单元。\n"
|
||||
" \n"
|
||||
" 运行组中的命令集合。这是对整个命令集合\n"
|
||||
" 做重定向的方法之一。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回最后一个执行的命令的状态。"
|
||||
|
||||
#: builtins.c:1644
|
||||
msgid ""
|
||||
@@ -3600,6 +4141,16 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns the status of the resumed job."
|
||||
msgstr ""
|
||||
"在前台继续任务\n"
|
||||
" \n"
|
||||
" 对于 JOB_SPEC 参数来说和 `fg' 命令等同。继续一个\n"
|
||||
" 停止的或者后台任务。JOB_SPEC 可以指定一个任务\n"
|
||||
" 名字或任务号。在 JOB_SPEC 后加上一个 `&' 将会把\n"
|
||||
" 任务放至后台,就像任务声明被作为 `bg' 命令的参数\n"
|
||||
" 执行一样。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 返回被继续的任务的状态。"
|
||||
|
||||
#: builtins.c:1659
|
||||
msgid ""
|
||||
@@ -3802,6 +4353,22 @@ msgid ""
|
||||
" Returns success if OPTNAME is enabled; fails if an invalid option is\n"
|
||||
" given or OPTNAME is disabled."
|
||||
msgstr ""
|
||||
"设定和反设定 shell 选项。\n"
|
||||
" \n"
|
||||
" 改变每个 shell 选项 OPTNAME的设定。不带参数\n"
|
||||
" 时,列出所有 shell 选项并标注每一个选项是否被\n"
|
||||
" 设定。\n"
|
||||
" \n"
|
||||
" 选项:\n"
|
||||
" -o\t限制 OPTNAME 为定义用于`set -o' 的选项\n"
|
||||
" -p\t打印每个 shell 选项并标注它的状态。\n"
|
||||
" -q\t抑制输出\n"
|
||||
" -s\t启用(设定)每个 OPTNAME 选项\n"
|
||||
" -u\t禁用(反设定)每个 OPTNAME 选项\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 如果 OPTNAME 选项被启用则返回成功;如果是\n"
|
||||
" 无效的选项或OPTNAME 被禁用则失败。"
|
||||
|
||||
#: builtins.c:1868
|
||||
msgid ""
|
||||
@@ -3864,6 +4431,14 @@ msgid ""
|
||||
" Exit Status:\n"
|
||||
" Returns success unless an invalid option is supplied or an error occurs."
|
||||
msgstr ""
|
||||
"依据选项显示可能的补完。\n"
|
||||
" \n"
|
||||
" 意图在能产生可能的补完的 shell 函数内部使用。\n"
|
||||
" 如果提供了可选的 WORD 参数,则产生按照 WORD\n"
|
||||
" 进行的匹配。\n"
|
||||
" \n"
|
||||
" 退出状态:\n"
|
||||
" 除非使用了无效选项或者错误发生,否则返回成功。"
|
||||
|
||||
#: builtins.c:1938
|
||||
msgid ""
|
||||
|
||||
@@ -1479,10 +1479,16 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
|
||||
|
||||
/* This logic must agree with parse.y:parse_matched_pair, since they
|
||||
share the same defines. */
|
||||
if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 0)
|
||||
if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == '#' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == '/' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == '^' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == ',' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", c) != 0)
|
||||
dolbrace_state = DOLBRACE_OP;
|
||||
else if (dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", c) == 0)
|
||||
@@ -3759,6 +3765,7 @@ mb_getcharlens (string, len)
|
||||
#define RP_LONG_RIGHT 3
|
||||
#define RP_SHORT_RIGHT 4
|
||||
|
||||
/* Returns its first argument if nothing matched; new memory otherwise */
|
||||
static char *
|
||||
remove_upattern (param, pattern, op)
|
||||
char *param, *pattern;
|
||||
@@ -3827,10 +3834,11 @@ remove_upattern (param, pattern, op)
|
||||
break;
|
||||
}
|
||||
|
||||
return (savestring (param)); /* no match, return original string */
|
||||
return (param); /* no match, return original string */
|
||||
}
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
/* Returns its first argument if nothing matched; new memory otherwise */
|
||||
static wchar_t *
|
||||
remove_wpattern (wparam, wstrlen, wpattern, op)
|
||||
wchar_t *wparam;
|
||||
@@ -3896,7 +3904,7 @@ remove_wpattern (wparam, wstrlen, wpattern, op)
|
||||
break;
|
||||
}
|
||||
|
||||
return (wcsdup (wparam)); /* no match, return original string */
|
||||
return (wparam); /* no match, return original string */
|
||||
}
|
||||
#endif /* HANDLE_MULTIBYTE */
|
||||
|
||||
@@ -3905,6 +3913,8 @@ remove_pattern (param, pattern, op)
|
||||
char *param, *pattern;
|
||||
int op;
|
||||
{
|
||||
char *xret;
|
||||
|
||||
if (param == NULL)
|
||||
return (param);
|
||||
if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */
|
||||
@@ -3917,18 +3927,29 @@ remove_pattern (param, pattern, op)
|
||||
size_t n;
|
||||
wchar_t *wparam, *wpattern;
|
||||
mbstate_t ps;
|
||||
char *xret;
|
||||
|
||||
n = xdupmbstowcs (&wpattern, NULL, pattern);
|
||||
if (n == (size_t)-1)
|
||||
return (remove_upattern (param, pattern, op));
|
||||
{
|
||||
xret = remove_upattern (param, pattern, op);
|
||||
return ((xret == param) ? savestring (param) : xret);
|
||||
}
|
||||
n = xdupmbstowcs (&wparam, NULL, param);
|
||||
if (n == (size_t)-1)
|
||||
{
|
||||
free (wpattern);
|
||||
return (remove_upattern (param, pattern, op));
|
||||
xret = remove_upattern (param, pattern, op);
|
||||
return ((xret == param) ? savestring (param) : xret);
|
||||
}
|
||||
oret = ret = remove_wpattern (wparam, n, wpattern, op);
|
||||
/* Don't bother to convert wparam back to multibyte string if nothing
|
||||
matched; just return copy of original string */
|
||||
if (ret == wparam)
|
||||
{
|
||||
free (wparam);
|
||||
free (wpattern);
|
||||
return (savestring (param));
|
||||
}
|
||||
|
||||
free (wparam);
|
||||
free (wpattern);
|
||||
@@ -3943,7 +3964,10 @@ remove_pattern (param, pattern, op)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return (remove_upattern (param, pattern, op));
|
||||
{
|
||||
xret = remove_upattern (param, pattern, op);
|
||||
return ((xret == param) ? savestring (param) : xret);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return 1 of the first character of STRING could match the first
|
||||
@@ -7155,6 +7179,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
|
||||
temp1 = parameter_brace_remove_pattern (name, temp, value, c, quoted);
|
||||
free (temp);
|
||||
free (value);
|
||||
free (name);
|
||||
|
||||
ret = alloc_word_desc ();
|
||||
ret->word = temp1;
|
||||
|
||||
@@ -1462,7 +1462,7 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
|
||||
if (c == '\'')
|
||||
{
|
||||
/*itrace("extract_dollar_brace_string: c == single quote flags = %d quoted = %d dolbrace_state = %d", flags, quoted, dolbrace_state);*/
|
||||
if (posixly_correct && /*shell_compatibility_level > 41 &&*/ dolbrace_state != DOLBRACE_QUOTE)
|
||||
if (posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE)
|
||||
ADVANCE_CHAR (string, slen, i);
|
||||
else
|
||||
{
|
||||
@@ -1479,10 +1479,16 @@ extract_dollar_brace_string (string, sindex, quoted, flags)
|
||||
|
||||
/* This logic must agree with parse.y:parse_matched_pair, since they
|
||||
share the same defines. */
|
||||
if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 0)
|
||||
if (dolbrace_state == DOLBRACE_PARAM && c == '%' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == '#' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == '/' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == '^' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && c == ',' && (i - *sindex) > 1)
|
||||
dolbrace_state = DOLBRACE_QUOTE;
|
||||
else if (dolbrace_state == DOLBRACE_PARAM && strchr ("#%^,~:-=?+/", c) != 0)
|
||||
dolbrace_state = DOLBRACE_OP;
|
||||
else if (dolbrace_state == DOLBRACE_OP && strchr ("#%^,~:-=?+/", c) == 0)
|
||||
@@ -3759,6 +3765,7 @@ mb_getcharlens (string, len)
|
||||
#define RP_LONG_RIGHT 3
|
||||
#define RP_SHORT_RIGHT 4
|
||||
|
||||
/* Returns its first argument if nothing matched; new memory otherwise */
|
||||
static char *
|
||||
remove_upattern (param, pattern, op)
|
||||
char *param, *pattern;
|
||||
@@ -3827,10 +3834,11 @@ remove_upattern (param, pattern, op)
|
||||
break;
|
||||
}
|
||||
|
||||
return (savestring (param)); /* no match, return original string */
|
||||
return (param); /* no match, return original string */
|
||||
}
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
/* Returns its first argument if nothing matched; new memory otherwise */
|
||||
static wchar_t *
|
||||
remove_wpattern (wparam, wstrlen, wpattern, op)
|
||||
wchar_t *wparam;
|
||||
@@ -3896,7 +3904,7 @@ remove_wpattern (wparam, wstrlen, wpattern, op)
|
||||
break;
|
||||
}
|
||||
|
||||
return (wcsdup (wparam)); /* no match, return original string */
|
||||
return (wparam); /* no match, return original string */
|
||||
}
|
||||
#endif /* HANDLE_MULTIBYTE */
|
||||
|
||||
@@ -3905,6 +3913,8 @@ remove_pattern (param, pattern, op)
|
||||
char *param, *pattern;
|
||||
int op;
|
||||
{
|
||||
char *xret;
|
||||
|
||||
if (param == NULL)
|
||||
return (param);
|
||||
if (*param == '\0' || pattern == NULL || *pattern == '\0') /* minor optimization */
|
||||
@@ -3917,18 +3927,27 @@ remove_pattern (param, pattern, op)
|
||||
size_t n;
|
||||
wchar_t *wparam, *wpattern;
|
||||
mbstate_t ps;
|
||||
char *xret;
|
||||
|
||||
n = xdupmbstowcs (&wpattern, NULL, pattern);
|
||||
if (n == (size_t)-1)
|
||||
return (remove_upattern (param, pattern, op));
|
||||
{
|
||||
xret = remove_upattern (param, pattern, op);
|
||||
return ((xret == param) ? savestring (param) : xret);
|
||||
}
|
||||
n = xdupmbstowcs (&wparam, NULL, param);
|
||||
if (n == (size_t)-1)
|
||||
{
|
||||
free (wpattern);
|
||||
return (remove_upattern (param, pattern, op));
|
||||
xret = remove_upattern (param, pattern, op);
|
||||
return ((xret == param) ? savestring (param) : xret);
|
||||
}
|
||||
oret = ret = remove_wpattern (wparam, n, wpattern, op);
|
||||
if (ret == wparam)
|
||||
{
|
||||
free (wparam);
|
||||
free (wpattern);
|
||||
return (savestring (param));
|
||||
}
|
||||
|
||||
free (wparam);
|
||||
free (wpattern);
|
||||
@@ -3943,7 +3962,10 @@ remove_pattern (param, pattern, op)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
return (remove_upattern (param, pattern, op));
|
||||
{
|
||||
xret = remove_upattern (param, pattern, op);
|
||||
return ((xret == param) ? savestring (param) : xret);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return 1 of the first character of STRING could match the first
|
||||
@@ -7155,6 +7177,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta
|
||||
temp1 = parameter_brace_remove_pattern (name, temp, value, c, quoted);
|
||||
free (temp);
|
||||
free (value);
|
||||
free (name);
|
||||
|
||||
ret = alloc_word_desc ();
|
||||
ret->word = temp1;
|
||||
|
||||
@@ -138,4 +138,7 @@ a
|
||||
|
||||
|
||||
b
|
||||
./builtins.tests: line 251: exit: status: numeric argument required
|
||||
before: f = 4
|
||||
inside
|
||||
after: f = 8 bar = 4
|
||||
./builtins.tests: line 254: exit: status: numeric argument required
|
||||
|
||||
@@ -247,6 +247,9 @@ kill -l ${sigone/SIG/}
|
||||
# test behavior of shopt xpg_echo
|
||||
${THIS_SH} ./builtins2.sub
|
||||
|
||||
# test behavior of declare -g
|
||||
${THIS_SH} ./builtins3.sub
|
||||
|
||||
# this must be last -- it is a fatal error
|
||||
exit status
|
||||
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
# tests for miscellaneous builtins not tested elsewhere
|
||||
set +p
|
||||
set +o posix
|
||||
|
||||
ulimit -c 0 2>/dev/null
|
||||
|
||||
# check that break breaks loops
|
||||
for i in a b c; do echo $i; break; echo bad-$i; done
|
||||
echo end-1
|
||||
for i in a b c; do echo $i; break 1; echo bad-$i; done
|
||||
echo end-2
|
||||
for i in a b c; do
|
||||
for j in x y z; do
|
||||
echo $i:$j
|
||||
break
|
||||
echo bad-$i
|
||||
done
|
||||
echo end-$i
|
||||
done
|
||||
echo end-3
|
||||
|
||||
# check that break breaks nested loops
|
||||
for i in a b c; do
|
||||
for j in x y z; do
|
||||
echo $i:$j
|
||||
break 2
|
||||
echo bad-$i
|
||||
done
|
||||
echo end-$i
|
||||
done
|
||||
echo end
|
||||
|
||||
# check that continue continues loops
|
||||
for i in a b c; do echo $i; continue; echo bad-$i ; done
|
||||
echo end-1
|
||||
for i in a b c; do echo $i; continue 1; echo bad-$i; done
|
||||
echo end-2
|
||||
for i in a b c; do
|
||||
for j in x y z; do
|
||||
echo $i:$j
|
||||
continue
|
||||
echo bad-$i-$j
|
||||
done
|
||||
echo end-$i
|
||||
done
|
||||
echo end-3
|
||||
|
||||
# check that continue breaks out of nested loops
|
||||
for i in a b c; do
|
||||
for j in x y z; do
|
||||
echo $i:$j
|
||||
continue 2
|
||||
echo bad-$i-$j
|
||||
done
|
||||
echo end-$i
|
||||
done
|
||||
echo end
|
||||
|
||||
# check that `eval' re-evaluates arguments, but `builtin' and `command' do not
|
||||
AVAR='$BVAR'
|
||||
BVAR=foo
|
||||
|
||||
echo $AVAR
|
||||
builtin echo $AVAR
|
||||
command echo $AVAR
|
||||
eval echo \$AVAR
|
||||
eval echo $AVAR
|
||||
|
||||
# test out eval with a temp environment
|
||||
AVAR=bar eval echo \$AVAR
|
||||
BVAR=xxx eval echo $AVAR
|
||||
|
||||
unset -v AVAR BVAR
|
||||
|
||||
# test umask
|
||||
mask=$(umask)
|
||||
umask 022
|
||||
umask
|
||||
umask -S
|
||||
umask -S u=rwx,g=rwx,o=rx >/dev/null # 002
|
||||
umask
|
||||
umask -S
|
||||
umask -p
|
||||
umask -p -S
|
||||
umask 0
|
||||
umask -S
|
||||
umask ${mask} # restore original mask
|
||||
|
||||
# builtin/command without arguments should do nothing. maybe someday they will
|
||||
builtin
|
||||
command
|
||||
|
||||
# test enable
|
||||
enable -ps
|
||||
|
||||
enable -aps ; enable -nps
|
||||
|
||||
enable -n test
|
||||
case "$(type -t test)" in
|
||||
builtin) echo oops -- enable -n test failed ;;
|
||||
*) echo enable -n test worked ;;
|
||||
esac
|
||||
|
||||
enable test
|
||||
case "$(type -t test)" in
|
||||
builtin) echo enable test worked ;;
|
||||
*) echo oops -- enable test failed ;;
|
||||
esac
|
||||
|
||||
# test options to exec
|
||||
(exec -a specialname ${THIS_SH} -c 'echo $0' )
|
||||
(exec -l -a specialname ${THIS_SH} -c 'echo $0' )
|
||||
# test `clean' environment. if /bin/sh is bash, and the script version of
|
||||
# printenv is run, there will be variables in the environment that bash
|
||||
# sets on startup. Also test code that prefixes argv[0] with a dash.
|
||||
(export FOO=BAR ; exec -c -l printenv ) | grep FOO
|
||||
(FOO=BAR exec -c printenv ) | grep FOO
|
||||
|
||||
(export FOO=BAR ; exec printenv ) | grep FOO
|
||||
(FOO=BAR exec printenv ) | grep FOO
|
||||
|
||||
# ok, forget everything about hashed commands
|
||||
hash -r
|
||||
hash
|
||||
|
||||
# this had better succeed, since command -p guarantees we will find the
|
||||
# standard utilties
|
||||
command -p hash rm
|
||||
|
||||
# check out source/.
|
||||
|
||||
# sourcing a zero-length-file had better not be an error
|
||||
rm -f /tmp/zero-length-file
|
||||
cp /dev/null /tmp/zero-length-file
|
||||
. /tmp/zero-length-file
|
||||
echo $?
|
||||
rm /tmp/zero-length-file
|
||||
|
||||
AVAR=AVAR
|
||||
|
||||
. ./source1.sub
|
||||
AVAR=foo . ./source1.sub
|
||||
|
||||
. ./source2.sub
|
||||
echo $?
|
||||
|
||||
set -- a b c
|
||||
. ./source3.sub
|
||||
|
||||
# make sure source with arguments does not change the shell's positional
|
||||
# parameters, but that the sourced file sees the arguments as its
|
||||
# positional parameters
|
||||
echo "$@"
|
||||
. ./source3.sub x y z
|
||||
echo "$@"
|
||||
|
||||
# but if the sourced script sets the positional parameters explicitly, they
|
||||
# should be reflected in the calling shell's positional parameters. this
|
||||
# also tests one of the shopt options that controls source using $PATH to
|
||||
# find the script
|
||||
echo "$@"
|
||||
shopt -u sourcepath
|
||||
. source4.sub
|
||||
echo "$@"
|
||||
|
||||
# this is complicated when the sourced scripts gets its own positional
|
||||
# parameters from arguments to `.'
|
||||
set -- a b c
|
||||
echo "$@"
|
||||
. source4.sub x y z
|
||||
echo "$@"
|
||||
|
||||
# test out cd and $CDPATH
|
||||
${THIS_SH} ./builtins1.sub
|
||||
|
||||
# test behavior of `.' when given a non-existant file argument
|
||||
${THIS_SH} ./source5.sub
|
||||
|
||||
# test bugs in sourcing non-regular files, fixed post-bash-3.2
|
||||
${THIS_SH} ./source6.sub
|
||||
|
||||
# in posix mode, assignment statements preceding special builtins are
|
||||
# reflected in the shell environment. `.' and `eval' need special-case
|
||||
# code.
|
||||
set -o posix
|
||||
echo $AVAR
|
||||
AVAR=foo . ./source1.sub
|
||||
echo $AVAR
|
||||
|
||||
AVAR=AVAR
|
||||
echo $AVAR
|
||||
AVAR=foo eval echo \$AVAR
|
||||
echo $AVAR
|
||||
|
||||
AVAR=AVAR
|
||||
echo $AVAR
|
||||
AVAR=foo :
|
||||
echo $AVAR
|
||||
set +o posix
|
||||
|
||||
# but assignment statements preceding `export' are always reflected in
|
||||
# the environment
|
||||
foo="" export foo
|
||||
declare -p foo
|
||||
unset foo
|
||||
|
||||
# assignment statements preceding `declare' should be displayed correctly,
|
||||
# but not persist after the command
|
||||
FOO='$$' declare -p FOO
|
||||
declare -p FOO
|
||||
unset FOO
|
||||
|
||||
# except for `declare -x', which should be equivalent to `export'
|
||||
FOO='$$' declare -x FOO
|
||||
declare -p FOO
|
||||
unset FOO
|
||||
|
||||
# test out kill -l. bash versions prior to 2.01 did `kill -l num' wrong
|
||||
sigone=$(kill -l | sed -n 's:^ 1) *\([^ ]*\)[ ].*$:\1:p')
|
||||
|
||||
case "$(kill -l 1)" in
|
||||
${sigone/SIG/}) echo ok;;
|
||||
*) echo oops -- kill -l failure;;
|
||||
esac
|
||||
|
||||
# kill -l and trap -l should display exactly the same output
|
||||
sigonea=$(trap -l | sed -n 's:^ 1) *\([^ ]*\)[ ].*$:\1:p')
|
||||
|
||||
if [ "$sigone" != "$sigonea" ]; then
|
||||
echo oops -- kill -l and trap -l differ
|
||||
fi
|
||||
|
||||
# POSIX.2 says that exit statuses > 128 are mapped to signal names by
|
||||
# subtracting 128 so you can find out what signal killed a process
|
||||
case "$(kill -l $(( 128 + 1)) )" in
|
||||
${sigone/SIG/}) echo ok;;
|
||||
*) echo oops -- kill -l 129 failure;;
|
||||
esac
|
||||
|
||||
# out-of-range signal numbers should report the argument in the error
|
||||
# message, not 128 less than the argument
|
||||
kill -l 4096
|
||||
|
||||
# kill -l NAME should return the signal number
|
||||
kill -l ${sigone/SIG/}
|
||||
|
||||
# test behavior of shopt xpg_echo
|
||||
${THIS_SH} ./builtins2.sub
|
||||
|
||||
# this must be last -- it is a fatal error
|
||||
exit status
|
||||
|
||||
echo after bad exit
|
||||
@@ -0,0 +1,14 @@
|
||||
# declare -g added in bash-4.2
|
||||
f=4
|
||||
|
||||
foo()
|
||||
{
|
||||
declare -g f=8
|
||||
declare -g bar=4
|
||||
|
||||
echo inside
|
||||
}
|
||||
|
||||
echo before: f = $f
|
||||
foo
|
||||
echo after: f = $f bar = $bar
|
||||
+8
-8
@@ -233,7 +233,7 @@ argv[1] = <oneonetwo>
|
||||
argv[1] = <onetwo>
|
||||
argv[1] = <two>
|
||||
argv[1] = <oneonetwo>
|
||||
./new-exp.tests: line 421: -2: substring expression < 0
|
||||
argv[1] = <a>
|
||||
argv[1] = <defghi>
|
||||
argv[1] = <efghi>
|
||||
argv[1] = <e*docrine>
|
||||
@@ -395,13 +395,13 @@ argv[6] = <w>
|
||||
argv[7] = <x>
|
||||
argv[8] = <y>
|
||||
argv[9] = <z>
|
||||
./new-exp.tests: line 480: $9: unbound variable
|
||||
./new-exp.tests: line 481: 9: unbound variable
|
||||
./new-exp.tests: line 482: UNSET: unbound variable
|
||||
./new-exp.tests: line 483: UNSET: unbound variable
|
||||
./new-exp.tests: line 482: $9: unbound variable
|
||||
./new-exp.tests: line 483: 9: unbound variable
|
||||
./new-exp.tests: line 484: UNSET: unbound variable
|
||||
./new-exp.tests: line 485: UNSET: unbound variable
|
||||
./new-exp.tests: line 486: UNSET: unbound variable
|
||||
./new-exp.tests: line 487: UNSET: unbound variable
|
||||
./new-exp.tests: line 488: UNSET: unbound variable
|
||||
argv[1] = <5>
|
||||
argv[1] = <#>
|
||||
argv[1] = <#>
|
||||
@@ -430,7 +430,7 @@ Case05---3---A:B:C---
|
||||
Case06---1---A B C::---
|
||||
Case07---3---A:B:C---
|
||||
Case08---3---A:B:C---
|
||||
./new-exp.tests: line 506: ${$(($#-1))}: bad substitution
|
||||
./new-exp.tests: line 508: ${$(($#-1))}: bad substitution
|
||||
argv[1] = <a>
|
||||
argv[2] = <b>
|
||||
argv[3] = <c>
|
||||
@@ -447,7 +447,7 @@ argv[1] = <a>
|
||||
argv[1] = <a>
|
||||
argv[2] = <b>
|
||||
argv[1] = <>
|
||||
./new-exp.tests: line 525: $(($# - 2)): substring expression < 0
|
||||
./new-exp.tests: line 527: $(($# - 2)): substring expression < 0
|
||||
argv[1] = <bin>
|
||||
argv[2] = <bin>
|
||||
argv[3] = <ucb>
|
||||
@@ -539,4 +539,4 @@ bar ()
|
||||
}
|
||||
argv[1] = </>
|
||||
argv[1] = </>
|
||||
./new-exp.tests: line 576: ABXD: parameter unset
|
||||
./new-exp.tests: line 578: ABXD: parameter unset
|
||||
|
||||
+3
-1
@@ -417,8 +417,10 @@ recho $c
|
||||
c=${var:4}
|
||||
expect nothing
|
||||
recho $c
|
||||
expect '<./new-exp.tests: -2: substring expression < 0>'
|
||||
# as of bash-4.2, negative LENGTH means offset from the end
|
||||
c=${var:0:-2}
|
||||
expect '<a>'
|
||||
recho $c
|
||||
|
||||
var=abcdefghi
|
||||
c=${var:3:12}
|
||||
|
||||
@@ -0,0 +1,577 @@
|
||||
# must do this because posix mode causes process substitution to be disabled
|
||||
# and flagged as a syntax error, which causes the shell to exit
|
||||
set +o posix
|
||||
|
||||
expect()
|
||||
{
|
||||
echo expect "$@"
|
||||
}
|
||||
|
||||
HOME=/usr/homes/chet # to make the check against new-exp.right work
|
||||
expect '<foo bar>'
|
||||
recho "${undef-"foo bar"}" # should be foo bar
|
||||
expect '<foo>'
|
||||
recho "${und="foo"}" # should be foo
|
||||
|
||||
expect "<$HOME>"
|
||||
recho ${HOME-"}"}
|
||||
expect "<$HOME>"
|
||||
recho "${HOME-'}'}"
|
||||
expect "<$HOME>"
|
||||
recho "${HOME-"}"}"
|
||||
|
||||
expect $0: 'HOME: }: syntax error: operand expected (error token is "}")'
|
||||
recho "${HOME:`echo }`}" # should be a math error -- bad substring substitution
|
||||
|
||||
expect unset
|
||||
_ENV=oops
|
||||
x=${_ENV[(_$-=0)+(_=1)-_${-%%*i*}]}
|
||||
echo ${x:-unset}
|
||||
|
||||
expect "<$HOME>"
|
||||
recho ${HOME}
|
||||
expect "<$HOME>"
|
||||
recho ${HOME:-`echo }`}
|
||||
expect "<$HOME>"
|
||||
recho ${HOME:-`echo "}"`}
|
||||
expect "<$HOME>"
|
||||
recho "${HOME:-`echo "}"`}"
|
||||
expect "<$HOME>"
|
||||
recho "$(echo "${HOME}")"
|
||||
expect "<$HOME>"
|
||||
recho "$(echo "$(echo ${HOME})")"
|
||||
expect "<$HOME>"
|
||||
recho "$(echo "$(echo "${HOME}")")"
|
||||
|
||||
P=*@*
|
||||
expect '<*@>'
|
||||
recho "${P%"*"}" #
|
||||
expect '<*@>'
|
||||
recho "${P%'*'}" #
|
||||
expect '<@*>'
|
||||
recho "${P#\*}" # should be @*
|
||||
|
||||
expect '<)>'
|
||||
recho "$(echo ")")" # should be )
|
||||
expect '<")">'
|
||||
recho "$(echo "\")\"")" # should be ")"
|
||||
|
||||
foo='abcd '
|
||||
expect '<-abcd> <->'
|
||||
recho -${foo}- # should be -abcd -
|
||||
expect '<-abcd> <->'
|
||||
recho -${foo% *}- # should be -abcd -
|
||||
expect '<-abcd->'
|
||||
recho -${foo%% *}- # should be -abcd-
|
||||
|
||||
foo=bar
|
||||
expect '<bar foo>'
|
||||
echo -n $foo' ' ; echo foo
|
||||
|
||||
expect '<bar foo>'
|
||||
echo -n $foo" " ; echo foo
|
||||
|
||||
expect '<bar foo>'
|
||||
echo -n "$foo " ; echo foo
|
||||
|
||||
expect '<barfoo>'
|
||||
echo -e "$foo\c " ; echo foo
|
||||
|
||||
expect '<barfoo>'
|
||||
echo -e $foo"\c " ; echo foo
|
||||
|
||||
# make sure backslashes are preserved in front of characters that are not
|
||||
# valid backslash escapes
|
||||
expect '<\x>'
|
||||
echo -e '\x'
|
||||
|
||||
# substring tests
|
||||
z=abcdefghijklmnop
|
||||
expect '<abcd>'
|
||||
recho ${z:0:4}
|
||||
|
||||
expect '<efg> <nop>'
|
||||
recho ${z:4:3} ${z:${#z}-3:3}
|
||||
|
||||
expect '<efg> <nop>'
|
||||
recho ${z:4:3} ${z: -3:3}
|
||||
|
||||
expect '<hijklmnop>'
|
||||
recho ${z:7:30}
|
||||
|
||||
expect '<abcdefghijklmnop>'
|
||||
recho ${z:0:100}
|
||||
|
||||
expect '<abcdefghijklmnop>'
|
||||
recho ${z:0:${#z}}
|
||||
|
||||
set 'ab cd' 'ef' 'gh ij' 'kl mn' 'op'
|
||||
expect '<ab cd> <ef>'
|
||||
recho "${@:1:2}"
|
||||
|
||||
expect '<gh ij> <kl mn>'
|
||||
recho "${@:3:2}"
|
||||
|
||||
expect '<gh ij> <kl mn> <op>'
|
||||
recho "${@:3:4}"
|
||||
|
||||
expect '<ab cd> <ef> <gh ij> <kl mn> <op>'
|
||||
recho "${@:1:$#}"
|
||||
|
||||
# code to ad-hoc parse arithmetic expressions in substring expansions was
|
||||
# broken until post-2.04
|
||||
base=/home/chet/foo//bar
|
||||
string1=$base/abcabcabc
|
||||
x=1 j=4
|
||||
|
||||
expect '</home/chet/foo//bar/abcabcabc>'
|
||||
recho ${string1:0}
|
||||
|
||||
expect '<home/chet/foo//bar/abcabcabc>'
|
||||
recho ${string1:1}
|
||||
|
||||
expect '<home>'
|
||||
recho ${string1:(j?1:0):j}
|
||||
|
||||
expect '<home>'
|
||||
recho ${string1:j?1:0:j}
|
||||
|
||||
expect '<home>'
|
||||
recho ${string1:(j?(x?1:0):0):j}
|
||||
|
||||
expect '<home>'
|
||||
recho ${string1:j?(x?1:0):0:j}
|
||||
|
||||
unset base string1 x j
|
||||
|
||||
# indirect variable references
|
||||
expect '<abcdefghijklmnop>'
|
||||
recho ${!9:-$z}
|
||||
|
||||
ef=4
|
||||
expect '<4>'
|
||||
recho ${!2}
|
||||
|
||||
expect '<op>'
|
||||
recho ${!#}
|
||||
|
||||
set a b c d e
|
||||
a=
|
||||
expect '<abcdefghijklmnop>'
|
||||
recho ${a:-$z}
|
||||
expect '<abcdefghijklmnop>'
|
||||
recho ${!1:-$z}
|
||||
|
||||
expect nothing
|
||||
recho ${a-$z}
|
||||
expect nothing
|
||||
recho ${!1-$z}
|
||||
|
||||
set -u
|
||||
expect $0: ABX: unbound variable
|
||||
( recho ${ABX} )
|
||||
set +u
|
||||
|
||||
expect $0: '$6: cannot assign in this way'
|
||||
recho ${6="arg6"}
|
||||
|
||||
v=abcde
|
||||
|
||||
# sed-like variable substitution
|
||||
expect '<xxcde>'
|
||||
recho ${v/a[a-z]/xx}
|
||||
expect '<axxde>'
|
||||
recho ${v/a??/axx}
|
||||
expect '<abxyz>'
|
||||
recho ${v/c??/xyz}
|
||||
expect '<abbcde>'
|
||||
recho ${v/#a/ab}
|
||||
expect '<abcde>'
|
||||
recho ${v/#d/ab}
|
||||
expect '<abcabe>'
|
||||
recho ${v/d/ab}
|
||||
expect '<abcdlast>'
|
||||
recho ${v/%?/last}
|
||||
expect '<abcde>'
|
||||
recho ${v/%x/last}
|
||||
|
||||
av=(abcd efgh ijkl mnop qrst uvwx)
|
||||
|
||||
expect '<xxcd>'
|
||||
recho ${av/??/xx}
|
||||
expect '<abxx>'
|
||||
recho ${av/%??/xx}
|
||||
expect '<xxgh>'
|
||||
recho ${av[1]/??/xx}
|
||||
expect '<efgh>'
|
||||
recho ${av[1]/%ab/xx}
|
||||
expect '<xxfgh>'
|
||||
recho ${av[1]/#?/xx}
|
||||
expect '<zagh>'
|
||||
recho ${av[1]/??/za}
|
||||
expect '<zaza>'
|
||||
recho ${av[1]//??/za}
|
||||
expect '<zagh>'
|
||||
recho ${av[1]/#??/za}
|
||||
expect '<efza>'
|
||||
recho ${av[1]/%??/za}
|
||||
|
||||
expect '<yyy> <yyy> <yyy> <yyy> <yyy> <yyy>'
|
||||
recho ${av[@]/*/yyy}
|
||||
expect '<yyy> <yyy> <yyy> <yyy> <yyy> <yyy>'
|
||||
recho ${av[@]/#*/yyy}
|
||||
expect '<yyy> <yyy> <yyy> <yyy> <yyy> <yyy>'
|
||||
recho ${av[@]/%*/yyy}
|
||||
expect '<yyy> <efgh> <ijkl> <mnop> <qrst> <uvwx>'
|
||||
recho ${av[@]/a*/yyy}
|
||||
expect '<abxx> <efxx> <ijxx> <mnxx> <qrxx> <uvxx>'
|
||||
recho ${av[@]/%??/xx}
|
||||
|
||||
set abcd efgh ijkl mnop qrst uvwx
|
||||
|
||||
expect '<xxcd>'
|
||||
recho ${1/??/xx}
|
||||
expect '<xxcd> <xxgh> <xxkl> <xxop> <xxst> <xxwx>'
|
||||
recho ${@/??/xx}
|
||||
expect '<xxcd> <xxgh> <xxkl> <xxop> <xxst> <xxwx>'
|
||||
recho ${@/%??/xx}
|
||||
expect '<zaza>'
|
||||
recho ${3//??/za}
|
||||
expect '<efza>'
|
||||
recho ${3/%??/za}
|
||||
expect '<zaza> <zaza> <zaza> <zaza> <zaza> <zaza>'
|
||||
recho ${@//??/za}
|
||||
expect '<zacd> <zagh> <zakl> <zaop> <zast> <zawx>'
|
||||
recho ${@/#??/za}
|
||||
expect '<yyy> <yyy> <yyy> <yyy> <yyy> <yyy>'
|
||||
recho ${@//*/yyy}
|
||||
expect '<yyy> <efgh> <ijkl> <mnop> <qrst> <uvwx>'
|
||||
recho ${@//a*/yyy}
|
||||
expect '<abcd> <efgh> <ijkl> <mnop> <qrst> <uvwyyy>'
|
||||
recho ${@/%x*/yyy}
|
||||
|
||||
expect a newline
|
||||
echo $abmcde
|
||||
|
||||
# sneaky way to replace a newline in a variable value with something else
|
||||
AVAR=$'This\nstring\nhas\nmultiple\nlines.'
|
||||
echo "${AVAR}"
|
||||
|
||||
eval BVAR=\"\${AVAR//$'\n'/-}\"
|
||||
echo "$BVAR"
|
||||
|
||||
unset AVAR BVAR
|
||||
|
||||
# run process substitution tests in a subshell so that syntax errors
|
||||
# caused by a shell not implementing process substitution (e.g., one
|
||||
# built on a NeXT) will not cause the whole test to exit prematurely
|
||||
${THIS_SH} ./new-exp1.sub
|
||||
|
||||
# run the tests of $(<filename) in a subshell to avoid cluttering up
|
||||
# this script
|
||||
${THIS_SH} ./new-exp2.sub
|
||||
|
||||
expect '<6>'
|
||||
recho ${#:-foo}
|
||||
expect $0: '${#:}: bad substitution'
|
||||
echo ${#:}
|
||||
|
||||
expect "<'>"
|
||||
recho "'"
|
||||
expect '<">'
|
||||
recho '"'
|
||||
expect '<"hello">'
|
||||
recho "\"hello\""
|
||||
|
||||
shift $#
|
||||
unset foo
|
||||
z=abcdef
|
||||
z1='abc def'
|
||||
|
||||
expect '<>'
|
||||
recho ${foo:-""}
|
||||
expect nothing
|
||||
recho ${foo:-"$@"}
|
||||
expect '<>'
|
||||
recho "${foo:-$@}"
|
||||
|
||||
# unset var
|
||||
expect '<>'
|
||||
recho ${foo:-"$zbcd"}
|
||||
expect nothing
|
||||
recho ${foo:-$zbcd}
|
||||
|
||||
# set var
|
||||
expect '<abcdef>'
|
||||
recho ${foo:-"$z"}
|
||||
expect '<abc def>'
|
||||
recho ${foo:-"$z1"}
|
||||
|
||||
expect '<abcdef>'
|
||||
recho ${foo:-$z}
|
||||
expect '<abc> <def>'
|
||||
recho ${foo:-$z1}
|
||||
|
||||
expect '<abcdef>'
|
||||
recho "${foo:-$z}"
|
||||
expect '<abc def>'
|
||||
recho "${foo:-$z1}"
|
||||
|
||||
expect '<abcdef>'
|
||||
recho "${foo:-"$z"}"
|
||||
# this disagrees with sh and ksh, but I think it is right according
|
||||
# to posix.2.
|
||||
expect '<abc def>'
|
||||
recho "${foo:-"$z1"}"
|
||||
|
||||
set ab cd ef gh
|
||||
expect '<ab> <cd> <ef> <gh>'
|
||||
recho ${foo:-"$@"}
|
||||
expect '<ab> <cd> <ef> <gh>'
|
||||
recho "${foo:-$@}"
|
||||
expect '<ab> <cd> <ef> <gh>'
|
||||
recho "${foo:-"$@"}"
|
||||
|
||||
shift $#
|
||||
expect nothing
|
||||
recho $xxx"$@"
|
||||
expect nothing
|
||||
recho ${foo:-$xxx"$@"}
|
||||
expect '<>'
|
||||
recho "${foo:-$xxx$@}"
|
||||
expect '<>'
|
||||
recho "${foo:-$xxx"$@"}"
|
||||
|
||||
expect nothing
|
||||
recho $xxx"$@"
|
||||
expect nothing
|
||||
recho "$xxx$@"
|
||||
expect nothing
|
||||
recho "$@"$xxx
|
||||
|
||||
expect '<>'
|
||||
recho $xxx""
|
||||
expect '<>'
|
||||
recho $xxx''
|
||||
expect '<>'
|
||||
recho ''$xxx
|
||||
expect '<>'
|
||||
recho ""$xxx
|
||||
|
||||
AB='abcdefghijklmnopqrstuvwxyz'
|
||||
|
||||
recho ${AB:7:15}
|
||||
recho ${AB:15:7}
|
||||
|
||||
recho ${AB:20}
|
||||
|
||||
recho ${AB:0}
|
||||
recho ${AB:0:20}
|
||||
|
||||
recho ${AB:10:7}
|
||||
recho ${AB:10:3+4}
|
||||
recho ${AB:20/2:3+4}
|
||||
|
||||
set 1 2 3 4 5 6
|
||||
recho \""${*:2:2}"\"
|
||||
|
||||
IFS=:
|
||||
recho \""${*:2:2}"\"
|
||||
|
||||
IFS=$' \t\n'
|
||||
|
||||
z=123456
|
||||
|
||||
recho \""${z:2:2}"\"
|
||||
recho \""${z:2}"\"
|
||||
recho \""${z:2:4}"\"
|
||||
recho \""${z:2:6}"\"
|
||||
|
||||
set $'\1' $'\2' $'\177'
|
||||
|
||||
recho $*
|
||||
recho $@
|
||||
|
||||
recho ${*}
|
||||
recho ${@}
|
||||
|
||||
xx=one/two/two
|
||||
recho ${xx%/*}
|
||||
recho ${xx/\/two}
|
||||
|
||||
yy=oneonetwo
|
||||
recho ${yy//one}
|
||||
recho ${yy/\/one}
|
||||
|
||||
xx=oneonetwo
|
||||
|
||||
recho ${xx/one}
|
||||
recho ${xx//one}
|
||||
recho ${xx/\/one}
|
||||
|
||||
# out-of-range substrings
|
||||
var=abc
|
||||
c=${var:3}
|
||||
expect nothing
|
||||
recho $c
|
||||
c=${var:4}
|
||||
expect nothing
|
||||
recho $c
|
||||
# as of bash-4.2, negative LENGTH means offset from the end
|
||||
expect '<a>'
|
||||
c=${var:0:-2}
|
||||
|
||||
var=abcdefghi
|
||||
c=${var:3:12}
|
||||
recho $c
|
||||
c=${var:4:20}
|
||||
recho $c
|
||||
|
||||
# make sure null patterns work
|
||||
xxx=endocrine
|
||||
yyy=n
|
||||
unset zzz
|
||||
|
||||
recho ${xxx/$yyy/*}
|
||||
recho ${xxx//$yyy/*}
|
||||
|
||||
recho ${xxx/$zzz/*}
|
||||
recho ${xxx//$zzz/*}
|
||||
|
||||
recho ${xxx//%${zzz}/}
|
||||
recho ${xxx//%${zzz}}
|
||||
recho ${xxx//#${zzz}/}
|
||||
recho ${xxx//#${zzz}}
|
||||
|
||||
# another case that caused a core dump in bash-2.0
|
||||
XPATH=/usr/bin:/bin:/usr/local/bin:/usr/gnu/bin::/usr/bin/X11:/sbin:/usr/sbin
|
||||
|
||||
recho ${XPATH//:/ }
|
||||
|
||||
xx=(ar as at au av aw ax ay az)
|
||||
|
||||
recho ${xx[@]/a/}
|
||||
recho ${xx[@]//a/}
|
||||
|
||||
recho ${xx[*]/a/}
|
||||
recho ${xx[*]//a/}
|
||||
|
||||
recho ${xx[@]%?}
|
||||
recho ${xx[*]%?}
|
||||
|
||||
recho ${xx[@]#?}
|
||||
recho ${xx[*]#?}
|
||||
|
||||
set -- ar as at au av aw ax ay az
|
||||
|
||||
recho ${@/a/}
|
||||
recho ${@//a/}
|
||||
|
||||
recho ${*/a/}
|
||||
recho ${*//a/}
|
||||
|
||||
recho ${@%?}
|
||||
recho ${*%?}
|
||||
|
||||
recho ${@#?}
|
||||
recho ${*#?}
|
||||
|
||||
shift $#
|
||||
set -u
|
||||
( recho $9 ; echo after 1)
|
||||
( recho ${9} ; echo after 2)
|
||||
( recho $UNSET ; echo after 3)
|
||||
( recho ${UNSET} ; echo after 4)
|
||||
( recho "$UNSET" ; echo after 5)
|
||||
( recho "${UNSET}" ; echo after 6)
|
||||
( recho "${#UNSET}" ; echo after 7)
|
||||
set +u
|
||||
|
||||
RECEIVED="12345"
|
||||
recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
|
||||
RECEIVED="12345#"
|
||||
recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
|
||||
RECEIVED="#"
|
||||
recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
|
||||
RECEIVED=""
|
||||
recho "${RECEIVED:$((${#RECEIVED}-1)):1}"
|
||||
|
||||
# tests of new prefix expansion ${!prefix*}
|
||||
${THIS_SH} ./new-exp3.sub
|
||||
|
||||
# bug with indirect expansion through bash-2.05b
|
||||
${THIS_SH} ./new-exp4.sub
|
||||
|
||||
# these caused errors and core dumps in versions before bash-2.04
|
||||
c=""
|
||||
echo ${c//${$(($#-1))}/x/}
|
||||
|
||||
set a b c d e f g
|
||||
recho "$@"
|
||||
|
||||
set -- ${@:1:$(($# - 2))}
|
||||
recho "$@"
|
||||
|
||||
set a b
|
||||
recho ${@:1:$(($# - 2))}
|
||||
|
||||
recho ${@:1:0}
|
||||
recho ${@:1:1}
|
||||
recho ${@:1:2}
|
||||
|
||||
recho "${*:1:0}"
|
||||
|
||||
# this is an error -- negative expression
|
||||
set a
|
||||
recho ${@:1:$(($# - 2))}
|
||||
|
||||
XPATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:.:/sbin:/usr/sbin
|
||||
set $( IFS=: ; echo $XPATH )
|
||||
|
||||
recho ${@##*/}
|
||||
recho ${@%%[!/]*}
|
||||
|
||||
recho ${@#/*}
|
||||
recho ${@%*/}
|
||||
|
||||
set /full/path/to/x16 /another/full/path
|
||||
|
||||
recho ${1%/*}
|
||||
recho ${1%%[!/]*}
|
||||
recho ${1#*/}
|
||||
recho ${1##*/}
|
||||
|
||||
${THIS_SH} ./new-exp5.sub
|
||||
|
||||
unset var
|
||||
var=blah
|
||||
|
||||
# these had better agree
|
||||
echo ${var[@]:3}
|
||||
echo ${var:3}
|
||||
echo ${var[@]/#/--}
|
||||
echo ${var/#/--}
|
||||
echo ${var[@]##?}
|
||||
echo ${var##?}
|
||||
|
||||
unset var
|
||||
var=(abcde abcfg abchi)
|
||||
|
||||
# problems with anchoring pattern replacements
|
||||
echo ${var[*]//#abc/foo}
|
||||
echo ${var[*]/#abc/foo}
|
||||
unset var
|
||||
|
||||
${THIS_SH} ./new-exp6.sub
|
||||
|
||||
${THIS_SH} ./new-exp7.sub
|
||||
|
||||
# problems with stray CTLNUL in bash-4.0-alpha
|
||||
unset a
|
||||
a=/a
|
||||
recho "/${a%/*}"
|
||||
recho "/${a///a/}"
|
||||
|
||||
# this must be last!
|
||||
expect $0: 'ABXD: parameter unset'
|
||||
recho ${ABXD:?"parameter unset"}
|
||||
+13
-2
@@ -1,3 +1,14 @@
|
||||
a
|
||||
b
|
||||
a b
|
||||
argv[1] = <a>
|
||||
argv[2] = <b>
|
||||
argv[3] = <x>
|
||||
argv[4] = <a>
|
||||
argv[5] = <b>
|
||||
argv[1] = <a\ b>
|
||||
argv[2] = <x>
|
||||
argv[3] = <a\ b>
|
||||
argv[1] = <foo 'bar' baz>
|
||||
argv[1] = <a b c d>
|
||||
argv[1] = <a b c d>
|
||||
@@ -26,5 +37,5 @@ argv[1] = <'bar>
|
||||
argv[1] = <foo 'bar baz>
|
||||
argv[1] = <z}>
|
||||
argv[1] = <''z}>
|
||||
./posixexp.tests: line 56: unexpected EOF while looking for matching `}'
|
||||
./posixexp.tests: line 59: syntax error: unexpected end of file
|
||||
./posixexp.tests: line 68: unexpected EOF while looking for matching `}'
|
||||
./posixexp.tests: line 69: syntax error: unexpected end of file
|
||||
|
||||
+12
-2
@@ -1,3 +1,15 @@
|
||||
unset a
|
||||
printf "%s\n" ${a:=a\ b}
|
||||
echo "$a"
|
||||
|
||||
unset v
|
||||
recho ${v=a\ b} x ${v=c\ d}
|
||||
|
||||
unset v
|
||||
recho "${v=a\ b}" x "${v=c\ d}"
|
||||
|
||||
unset a v
|
||||
|
||||
recho "foo ${IFS+'bar'} baz"
|
||||
recho "a ${IFS+b c} d"
|
||||
|
||||
@@ -54,5 +66,3 @@ recho "${IFS+'}'z}"
|
||||
# this will be an error
|
||||
foo=bar
|
||||
echo "${foo:-"a}"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
recho "foo ${IFS+'bar'} baz"
|
||||
recho "a ${IFS+b c} d"
|
||||
|
||||
recho "a ${IFS+"b c"} d"
|
||||
|
||||
u=x
|
||||
recho "foo ${IFS+a$u{{{\}b} c ${IFS+d{}} bar" ${IFS-e{}} baz
|
||||
|
||||
a=foo
|
||||
recho "${IFS+'$a'}"
|
||||
recho "${IFS+"'$a'"}"
|
||||
|
||||
recho ${IFS+'$a'}
|
||||
recho ${IFS+"'$a'"}
|
||||
|
||||
unset a u
|
||||
x='foo*bar'
|
||||
|
||||
recho "${x##"}"}"
|
||||
recho "${x##'}'}"
|
||||
recho "${x##'}"
|
||||
|
||||
recho "${x:-'}'}"
|
||||
|
||||
foo="x'a'y"
|
||||
recho "${foo%*'a'*}"
|
||||
unset x
|
||||
|
||||
unset u
|
||||
v=w
|
||||
printf '<%s> ' ${u+x} . ${v+x} . "${u+x}" . "${v+x}" .; echo
|
||||
printf '<%s> ' ${u-x} . ${v-x} . "${u-x}" . "${v-x}" .; echo
|
||||
printf '<%s> ' ${u=x} . ${v=x} . "${u=x}" . "${v=x}" .; echo
|
||||
printf '<%s> ' ${u?x} . ${v?x} . "${u?x}" . "${v?x}" .; echo
|
||||
printf '<%s> ' ${u#x} . ${v#x} . "${u#x}" . "${v#x}" .; echo
|
||||
printf '<%s> ' ${u%x} . ${v%x} . "${u%x}" . "${v%x}" .; echo
|
||||
printf '<%s> ' ${u:+x} . ${v:+x} . "${u:+x}" . "${v:+x}" .; echo
|
||||
printf '<%s> ' ${u:-x} . ${v:-x} . "${u:-x}" . "${v:-x}" .; echo
|
||||
printf '<%s> ' ${u:=x} . ${v:=x} . "${u:=x}" . "${v:=x}" .; echo
|
||||
printf '<%s> ' ${u:?x} . ${v:?x} . "${u:?x}" . "${v:?x}" .; echo
|
||||
# these are invalid substitution operators
|
||||
#printf '<%s> ' ${u:#x} . ${v:#x} . "${u:#x}" . "${v:#x}" .; echo
|
||||
#printf '<%s> ' ${u:%x} . ${v:%x} . "${u:%x}" . "${v:%x}" .; echo
|
||||
|
||||
unset foo
|
||||
set -o posix
|
||||
|
||||
recho "${IFS+'bar}"
|
||||
recho "foo ${IFS+'bar} baz"
|
||||
|
||||
recho ${IFS+'}'z}
|
||||
recho "${IFS+'}'z}"
|
||||
|
||||
# this will be an error
|
||||
foo=bar
|
||||
echo "${foo:-"a}"
|
||||
@@ -0,0 +1,41 @@
|
||||
1
|
||||
0
|
||||
a
|
||||
real 0.00
|
||||
user 0.00
|
||||
sys 0.00
|
||||
1
|
||||
a
|
||||
real 0.00
|
||||
user 0.00
|
||||
sys 0.00
|
||||
1
|
||||
tfunc is a function
|
||||
tfunc ()
|
||||
{
|
||||
time
|
||||
}
|
||||
1
|
||||
0
|
||||
1
|
||||
a
|
||||
real 0.00
|
||||
user 0.00
|
||||
sys 0.00
|
||||
0
|
||||
a
|
||||
real 0.00
|
||||
user 0.00
|
||||
sys 0.00
|
||||
0
|
||||
a
|
||||
real 0.00
|
||||
user 0.00
|
||||
sys 0.00
|
||||
0
|
||||
1
|
||||
0
|
||||
a
|
||||
real 0.00
|
||||
user 0.00
|
||||
sys 0.00
|
||||
@@ -0,0 +1,43 @@
|
||||
# Test timed and negated pipelines in bash-4.2 and later
|
||||
export TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'
|
||||
|
||||
!
|
||||
echo $?
|
||||
|
||||
! !
|
||||
echo $?
|
||||
|
||||
time ! echo a
|
||||
echo $?
|
||||
|
||||
! time echo a
|
||||
echo $?
|
||||
|
||||
tfunc()
|
||||
{
|
||||
time
|
||||
}
|
||||
|
||||
type tfunc
|
||||
|
||||
! true
|
||||
echo $?
|
||||
! ! true
|
||||
echo $?
|
||||
! ! ! true
|
||||
echo $?
|
||||
|
||||
time time echo a
|
||||
echo $?
|
||||
|
||||
time time -p echo a
|
||||
echo $?
|
||||
time -p time echo a
|
||||
echo $?
|
||||
|
||||
!
|
||||
echo $?
|
||||
! !
|
||||
echo $?
|
||||
|
||||
time -p -- echo a
|
||||
@@ -0,0 +1,41 @@
|
||||
# Test timed and negated pipelines in bash-4.2 and later
|
||||
export TIMEFORMAT=$'real %2R\nuser %2U\nsys %2S'
|
||||
|
||||
!
|
||||
echo $?
|
||||
|
||||
! !
|
||||
echo $?
|
||||
|
||||
time ! echo a
|
||||
echo $?
|
||||
|
||||
! time echo a
|
||||
echo $?
|
||||
|
||||
tfunc()
|
||||
{
|
||||
time
|
||||
}
|
||||
|
||||
type tfunc
|
||||
|
||||
! true
|
||||
echo $?
|
||||
! ! true
|
||||
echo $?
|
||||
! ! ! true
|
||||
echo $?
|
||||
|
||||
time time echo a
|
||||
echo $?
|
||||
|
||||
time time -p echo a
|
||||
echo $?
|
||||
time -p time echo a
|
||||
echo $?
|
||||
|
||||
!
|
||||
echo $?
|
||||
! !
|
||||
echo $?
|
||||
+1
-1
@@ -27,7 +27,7 @@ do
|
||||
*.orig|*~) ;;
|
||||
run-dollars|run-execscript|run-func|run-getopts|run-heredoc) echo $x ; sh $x ;;
|
||||
run-ifs-tests|run-input-test|run-invert|run-more-exp|run-nquote) echo $x ; sh $x ;;
|
||||
run-ifs-posix|run-posix2|run-posixpat) echo $x ; sh $x ;;
|
||||
run-ifs-posix|run-posix2|run-posixpat|run-posixpipe) echo $x ; sh $x ;;
|
||||
run-precedence|run-quote|run-read|run-rhs-exp|run-strip|run-tilde) echo $x ; sh $x ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# run-minimal - a version of run-all for shells configured with
|
||||
# --enable-minimal-config
|
||||
#
|
||||
PATH=.:$PATH # just to get the right version of printenv
|
||||
export PATH
|
||||
|
||||
# unset BASH_ENV only if it is set
|
||||
[ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV
|
||||
# ditto for SHELLOPTS
|
||||
#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS
|
||||
|
||||
: ${THIS_SH:=../bash}
|
||||
export THIS_SH
|
||||
|
||||
${THIS_SH} ./version.mini
|
||||
|
||||
rm -f /tmp/xx
|
||||
|
||||
echo Testing ${THIS_SH}
|
||||
echo Any output from any test, unless otherwise noted, indicates a possible anomaly
|
||||
for x in run-*
|
||||
do
|
||||
case $x in
|
||||
$0) ;;
|
||||
*.orig|*~) ;;
|
||||
run-dollars|run-execscript|run-func|run-getopts|run-heredoc) echo $x ; sh $x ;;
|
||||
run-ifs-tests|run-input-test|run-invert|run-more-exp|run-nquote) echo $x ; sh $x ;;
|
||||
run-ifs-posix|run-posix2|run-posixpat) echo $x ; sh $x ;;
|
||||
run-precedence|run-quote|run-read|run-rhs-exp|run-strip|run-tilde) echo $x ; sh $x ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,2 @@
|
||||
${THIS_SH} ./posixpipe.tests > /tmp/xx 2>&1
|
||||
diff /tmp/xx posixpipe.right && rm -f /tmp/xx
|
||||
@@ -0,0 +1,2 @@
|
||||
${THIS_SH} ./posixexp.tests > /tmp/xx 2>&1
|
||||
diff /tmp/xx posixexp.right && rm -f /tmp/xx
|
||||
@@ -53,6 +53,7 @@ trap -- 'echo aborting' SIGQUIT
|
||||
trap -- 'echo aborting' SIGABRT
|
||||
trap -- 'echo aborting' SIGTERM
|
||||
0
|
||||
trap -- '' SIGUSR2
|
||||
ERRTRAP
|
||||
ERRTRAP
|
||||
ERRTRAP
|
||||
|
||||
Reference in New Issue
Block a user