bash-20140131 remove leftover and stray files

This commit is contained in:
Chet Ramey
2014-02-04 09:48:38 -05:00
parent 65450bbf93
commit 387affeb74
22 changed files with 0 additions and 26357 deletions
-47
View File
@@ -1,47 +0,0 @@
#Date: Mon, 14 Dec 1998 23:10:43 -0800
#From: John Kinsella <jlk@digex.net>
#To: chet@po.cwru.edu
#Subject: Re: bash patch
diff -c bash-2.02.1-old/bashhist.c bash-2.02.1/bashhist.c
*** bash-2.02.1-old/bashhist.c Fri Feb 27 09:34:33 1998
--- bash-2.02.1/bashhist.c Mon Dec 14 22:39:23 1998
***************
*** 50,55 ****
--- 50,65 ----
# include "bashline.h"
#endif
+ /* SYSLOG_HISTORY - define this if you want all commands entered into
+ * the shell to be echoed to syslog.
+ * (feature added by John Kinsella<jlk@digex.net>)
+ */
+ #define SYSLOG_HISTORY 1
+
+ #if defined (SYSLOG_HISTORY)
+ # include <syslog.h>
+ #endif
+
#if !defined (errno)
extern int errno;
#endif
***************
*** 566,571 ****
--- 576,587 ----
{
hist_last_line_added = 1;
add_history (line);
+ /* next 3 lines added by John Kinsella<jlk@digex.net>
+ * Sends history line to syslog.
+ */
+ #if defined( SYSLOG_HISTORY )
+ syslog( LOG_INFO, "%d - %s", current_user.euid, line );
+ #endif
history_lines_this_session++;
}
using_history ();
#
#--
#John Kinsella UNIX ISA
#jlk@digex.net DIGEX West Coast Facility
#voice 408-873-4278 pager 888-751-7595
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.sigs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Binary file not shown.
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.sigstat</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
-17
View File
@@ -1,17 +0,0 @@
#else
/* This code implements the `rest of the fields and their intervening
separators' portion of the Posix spec. The latest interpretation says
that the last non-IFS white space separator (and any adjacent IFS
white space) is removed. We repeatedly parse fields, stopping when the
last results in us hitting the end of INPUT_STRING. */
savei = t = input_string;
while (*input_string)
{
/* This call updates INPUT_STRING. */
t1 = get_word_from_string (&input_string, ifs_chars, &e);
if (*input_string)
t = input_string;
}
*t = '\0';
input_string = savei;
#endif
-294
View File
@@ -1,294 +0,0 @@
# This Makefile is for the Bash/documentation directory -*- text -*-.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
PACKAGE = bash
VERSION = 3.2-maint
PACKAGE_BUGREPORT = bug-bash@gnu.org
PACKAGE_NAME = bash
PACKAGE_STRING = bash 3.2-maint
PACKAGE_VERSION = 3.2-maint
#
SHELL = /bin/sh
RM = rm -f
topdir = /Users/chet/src/bash/src
srcdir = /Users/chet/src/bash/src/doc
VPATH = .:/Users/chet/src/bash/src/doc
prefix = /usr/local
exec_prefix = ${prefix}
infodir = ${prefix}/share/info
# set this to a directory name to have the HTML files installed
htmldir = ${docdir}
# Support an alternate destination root directory for package building
DESTDIR =
mandir = ${prefix}/share/man
manpfx = man
man1ext = .1
man1dir = $(mandir)/$(manpfx)1
man3ext = .3
man3dir = $(mandir)/$(manpfx)3
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
BUILD_DIR = /usr/local/build/chet/bash/bash-current
SUPPORT_SRCDIR = $(topdir)/support
# bad style
RL_LIBDIR = $(topdir)/lib/readline
# unused
TEXINDEX = texindex
TEX = tex
MAKEINFO = makeinfo
TEXI2DVI = ${SUPPORT_SRCDIR}/texi2dvi
TEXI2HTML = ${SUPPORT_SRCDIR}/texi2html
MAN2HTML = ${BUILD_DIR}/support/man2html
HTMLPOST = ${srcdir}/htmlpost.sh
INFOPOST = ${srcdir}/infopost.sh
QUIETPS = #set this to -q to shut up dvips
PAPERSIZE = letter # change to a4 for A4-size paper
PSDPI = 600 # could be 300 if you like
DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky
TEXINPUTDIR = $(RL_LIBDIR)/doc
SET_TEXINPUTS = TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS
# These tools might not be available; they're not required
DVIPDF = dvipdfm -o $@ -p ${PAPERSIZE}
PSPDF = gs -sPAPERSIZE=${PAPERSIZE} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -sOutputFile=$@
MKDIRS = ${SUPPORT_SRCDIR}/mkdirs
# This should be a program that converts troff to an ascii-readable format
NROFF = groff -Tascii
# This should be a program that converts troff to postscript
GROFF = groff
HSUSER = $(RL_LIBDIR)/doc/hsuser.texi
RLUSER = $(RL_LIBDIR)/doc/rluser.texi
BASHREF_FILES = $(srcdir)/bashref.texi $(srcdir)/version.texi
.SUFFIXES: .0 .1 .3 .ms .ps .txt .dvi .html .pdf
.1.ps:
$(RM) $@
-${GROFF} -man $< > $@
.1.0:
$(RM) $@
-${NROFF} -man $< > $@
.1.html:
$(RM) $@
-${MAN2HTML} $< | ${HTMLPOST} > $@
.ms.ps:
$(RM) $@
-${GROFF} -ms $< > $@
.ms.txt:
$(RM) $@
-${NROFF} -ms $< > $@
.3.ps:
$(RM) $@
-${GROFF} -man $< > $@
.3.0:
$(RM) $@
-${NROFF} -man $< > $@
.3.html:
$(RM) $@
-${MAN2HTML} $< > $@
.ps.pdf:
$(RM) $@
-${PSPDF} $<
.dvi.pdf:
$(RM) $@
-${DVIPDF} $<
.dvi.ps:
${RM} $@
-${DVIPS} $<
all: ps info dvi text html
nodvi: ps info text html
PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
DVIFILES = bashref.dvi bashref.ps
INFOFILES = bashref.info
MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0
HTMLFILES = bashref.html bash.html
PDFFILES = bash.pdf bashref.pdf article.pdf rose94.pdf
ps: ${PSFILES}
dvi: ${DVIFILES}
info: ${INFOFILES}
text: ${MAN0FILES}
html: ${HTMLFILES}
pdf: ${PDFFILES}
bashref.dvi: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
${SET_TEXINPUTS} $(TEXI2DVI) $(srcdir)/bashref.texi
bashref.info: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
$(MAKEINFO) --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
bashref.html: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
b.html: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
./texi2html.debug -o $@ -verbose -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
bash.info: bashref.info
${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
bash.txt: bash.1
bash.ps: bash.1
bash.html: bash.1 $(MAN2HTML)
bashbug.ps: bashbug.1
builtins.ps: builtins.1 bash.1
rbash.ps: rbash.1 bash.1
bash.0: bash.1
bashbug.0: bashbug.1
builtins.0: builtins.1 bash.1
rbash.0: rbash.1 bash.1
article.ps: article.ms
bashref.ps: bashref.dvi
article.pdf: article.ps
bashref.pdf: bashref.dvi
bash.pdf: bash.ps
rose94.pdf: rose94.ps
$(MAN2HTML): ${topdir}/support/man2html.c
-( cd ${BUILD_DIR}/support ; ${MAKE} ${MFLAGS} man2html)
clean:
$(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \
*.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o
${RM} core *.core
mostlyclean: clean
$(RM) Makefile
distclean: clean maybe-clean
$(RM) Makefile
maintainer-clean: clean
${RM} ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}
${RM} ${CREATED_FAQ}
$(RM) Makefile
maybe-clean:
-if test "X$(topdir)" != "X$(BUILD_DIR)"; then \
$(RM) ${PSFILES} ${DVIFILES} ${INFOFILES} ${MAN0FILES} ${HTMLFILES}; \
fi
installdirs:
-$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(man1dir)
-$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(infodir)
-if test -n "$(htmldir)" ; then \
$(SHELL) $(SUPPORT_SRCDIR)/mkinstalldirs $(DESTDIR)$(htmldir) ; \
fi
install: info installdirs bash.info
-$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext}
-$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext}
# uncomment the next line to install the builtins man page
# -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext}
-$(INSTALL_DATA) $(srcdir)/bash.info $(DESTDIR)$(infodir)/bash.info
# run install-info if it is present to update the info directory
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \
else true; fi
# if htmldir is set, install the html files into that directory
-if test -n "${htmldir}" ; then \
$(INSTALL_DATA) $(srcdir)/bash.html $(DESTDIR)$(htmldir) ; \
$(INSTALL_DATA) $(srcdir)/bashref.html $(DESTDIR)$(htmldir) ; \
fi
uninstall:
-$(RM) $(DESTDIR)$(man1dir)/bash${man1ext} $(DESTDIR)$(man1dir)/bashbug${man1ext}
$(RM) $(DESTDIR)$(infodir)/bash.info
-if test -n "$(htmldir)" ; then \
$(RM) $(DESTDIR)$(htmldir)/bash.html ; \
$(RM) $(DESTDIR)$(htmldir)/bashref.html ; \
fi
# for use by chet
CREATED_FAQ = faq.news faq.news2 faq.mail faq.version
faq: ${CREATED_FAQ}
faq.version: FAQ.version FAQ
sh mkfaqvers FAQ.version > $@
faq.headers.mail: FAQ.headers.mail FAQ
sh mkfaqvers FAQ.headers.mail > $@
faq.headers.news: FAQ.headers.news FAQ
sh mkfaqvers FAQ.headers.news > $@
faq.headers.news2: FAQ.headers.news2 FAQ
sh mkfaqvers FAQ.headers.news2 > $@
faq.news: FAQ faq.headers.news faq.version
$(RM) $@
cat faq.headers.news faq.version FAQ > $@
faq.news2: FAQ faq.headers.news2 faq.version
$(RM) $@
cat faq.headers.news2 faq.version FAQ > $@
faq.mail: FAQ faq.headers.mail faq.version
$(RM) $@
cat faq.headers.mail faq.version FAQ > $@
inst: bashref.texi
$(SHELL) ./mkinstall
cmp -s INSTALL ../INSTALL || mv INSTALL ../INSTALL
$(RM) INSTALL
posix: bashref.texi
$(SHELL) ./mkposix
cmp -s POSIX ../POSIX || mv POSIX ../POSIX
$(RM) POSIX
rbash: bashref.texi
$(SH) ./mkrbash
cmp -s RBASH ../RBASH || mv RBASH ../RBASH
$(RM) RBASH
xdist: pdf inst posix rbash
-10220
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-301
View File
@@ -1,301 +0,0 @@
/*
*
* Another test harness for the readline callback interface.
*
* Author: Bob Rossi <bob@brasko.net>
*/
#if defined (HAVE_CONFIG_H)
#include <config.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
#include <curses.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#if 0 /* LINUX */
#include <pty.h>
#else
#include <util.h>
#endif
#ifdef READLINE_LIBRARY
# include "readline.h"
#else
# include <readline/readline.h>
#endif
/**
* Master/Slave PTY used to keep readline off of stdin/stdout.
*/
static int masterfd = -1;
static int slavefd;
void
sigint (s)
int s;
{
tty_reset (STDIN_FILENO);
close (masterfd);
close (slavefd);
printf ("\n");
exit (0);
}
static int
user_input()
{
int size;
const int MAX = 1024;
char *buf = (char *)malloc(MAX+1);
size = read (STDIN_FILENO, buf, MAX);
if (size == -1)
return -1;
size = write (masterfd, buf, size);
if (size == -1)
return -1;
return 0;
}
static int
readline_input()
{
const int MAX = 1024;
char *buf = (char *)malloc(MAX+1);
int size;
size = read (masterfd, buf, MAX);
if (size == -1)
{
free( buf );
buf = NULL;
return -1;
}
buf[size] = 0;
/* Display output from readline */
if ( size > 0 )
fprintf(stderr, "%s", buf);
free( buf );
buf = NULL;
return 0;
}
static void
rlctx_send_user_command(char *line)
{
/* This happens when rl_callback_read_char gets EOF */
if ( line == NULL )
return;
if (strcmp (line, "exit") == 0) {
tty_reset (STDIN_FILENO);
close (masterfd);
close (slavefd);
printf ("\n");
exit (0);
}
/* Don't add the enter command */
if ( line && *line != '\0' )
add_history(line);
}
static void
custom_deprep_term_function ()
{
}
static int
init_readline (int inputfd, int outputfd)
{
FILE *inputFILE, *outputFILE;
inputFILE = fdopen (inputfd, "r");
if (!inputFILE)
return -1;
outputFILE = fdopen (outputfd, "w");
if (!outputFILE)
return -1;
rl_instream = inputFILE;
rl_outstream = outputFILE;
/* Tell readline what the prompt is if it needs to put it back */
rl_callback_handler_install("(rltest): ", rlctx_send_user_command);
/* Set the terminal type to dumb so the output of readline can be
* understood by tgdb */
if ( rl_reset_terminal("dumb") == -1 )
return -1;
/* For some reason, readline can not deprep the terminal.
* However, it doesn't matter because no other application is working on
* the terminal besides readline */
rl_deprep_term_function = custom_deprep_term_function;
using_history();
read_history(".history");
return 0;
}
static int
main_loop(void)
{
fd_set rset;
int max;
max = (masterfd > STDIN_FILENO) ? masterfd : STDIN_FILENO;
max = (max > slavefd) ? max : slavefd;
for (;;)
{
/* Reset the fd_set, and watch for input from GDB or stdin */
FD_ZERO(&rset);
FD_SET(STDIN_FILENO, &rset);
FD_SET(slavefd, &rset);
FD_SET(masterfd, &rset);
/* Wait for input */
if (select(max + 1, &rset, NULL, NULL, NULL) == -1)
{
if (errno == EINTR)
continue;
else
return -1;
}
/* Input received through the pty: Handle it
* Wrote to masterfd, slave fd has that input, alert readline to read it.
*/
if (FD_ISSET(slavefd, &rset))
rl_callback_read_char();
/* Input received through the pty.
* Readline read from slavefd, and it wrote to the masterfd.
*/
if (FD_ISSET(masterfd, &rset))
if ( readline_input() == -1 )
return -1;
/* Input received: Handle it, write to masterfd (input to readline) */
if (FD_ISSET(STDIN_FILENO, &rset))
if ( user_input() == -1 )
return -1;
}
return 0;
}
/* The terminal attributes before calling tty_cbreak */
static struct termios save_termios;
static struct winsize size;
static enum { RESET, TCBREAK } ttystate = RESET;
/* tty_cbreak: Sets terminal to cbreak mode. Also known as noncanonical mode.
* 1. Signal handling is still turned on, so the user can still type those.
* 2. echo is off
* 3. Read in one char at a time.
*
* fd - The file descriptor of the terminal
*
* Returns: 0 on sucess, -1 on error
*/
int tty_cbreak(int fd){
struct termios buf;
int ttysavefd = -1;
if(tcgetattr(fd, &save_termios) < 0)
return -1;
buf = save_termios;
buf.c_lflag &= ~(ECHO | ICANON);
buf.c_iflag &= ~(ICRNL | INLCR);
buf.c_cc[VMIN] = 1;
buf.c_cc[VTIME] = 0;
#if defined (VLNEXT) && defined (_POSIX_VDISABLE)
buf.c_cc[VLNEXT] = _POSIX_VDISABLE;
#endif
#if defined (VDSUSP) && defined (_POSIX_VDISABLE)
buf.c_cc[VDSUSP] = _POSIX_VDISABLE;
#endif
if(tcsetattr(fd, TCSAFLUSH, &buf) < 0)
return -1;
ttystate = TCBREAK;
ttysavefd = fd;
/* set size */
if(ioctl(fd, TIOCGWINSZ, (char *)&size) < 0)
return -1;
#ifdef DEBUG
err_msg("%d rows and %d cols\n", size.ws_row, size.ws_col);
#endif
return (0);
}
/* tty_reset: Sets the terminal attributes back to their previous state.
* PRE: tty_cbreak must have already been called.
*
* fd - The file descrioptor of the terminal to reset.
*
* Returns: 0 on success, -1 on error
*/
int tty_reset(int fd){
if(ttystate != TCBREAK)
return (0);
if(tcsetattr(fd, TCSAFLUSH, &save_termios) < 0)
return (-1);
ttystate = RESET;
return 0;
}
int
main()
{
int val;
val = openpty (&masterfd, &slavefd, NULL, NULL, NULL);
if (val == -1)
return -1;
val = init_readline (slavefd, slavefd);
if (val == -1)
return -1;
val = tty_cbreak (STDIN_FILENO);
if (val == -1)
return -1;
signal (SIGINT, sigint);
val = main_loop ();
tty_reset (STDIN_FILENO);
if (val == -1)
return -1;
return 0;
}
-2845
View File
File diff suppressed because it is too large Load Diff
-5521
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
-70
View File
@@ -1,70 +0,0 @@
#! /bin/bash
DATE=$(date +%Y%m%d)
PARENT=/fs2/chet/bash
FROOT=bash-$DATE
DIR=$PARENT/$FROOT
TARF=${FROOT}.tar
SRC=/usr/homes/chet/src/bash/src
fflag= sflag= dflag=
while getopts "dfsp:" opt
do
case $opt in
d) dflag=1 ;;
f) fflag=1 ;;
p) PARENT=$OPTARG
if [ ! -d "$PARENT" ]; then
echo "mk-takehome: $PARENT: directory does not exist" 2>&1
exit 2
fi ;;
s) sflag=1 ;;
*) echo "mk-takehome: usage: mk-takehome [-dfs]" 2>&1
exit 2;;
esac
done
shift $(($OPTIND - 1))
if [ -n "$fflag" ]; then
rm -rf "$DIR"
fi
mkdir $DIR || exit 1
cd $DIR || exit 1
cd $SRC || exit 1
tar cf - . | (cd $DIR ; tar xvpf - )
cd $DIR || exit 1
find . -type f -name '*~' -print | xargs rm -f
find . -type d -name 'savedir' -print | xargs rm -rf
rm parser-built y.tab.c y.tab.h
# bison -y -d parse.y # make sure y.tab.h present for dependencies
rm -f d d? ddd ddd? # convention for temp diff files
cd $PARENT || exit 1
tar cvf ${TARF} $FROOT
gzip -v ${TARF}
REMHOST=z4
if [ -n "$sflag" ]; then
scp ${TARF}.gz ${REMHOST}:
fi
if [ -n "$dflag" ]; then
if [ ! -d $HOME/Dropbox ]; then
HOME=~chet
fi
cp ${TARF}.gz $HOME/Dropbox/
fi
-9
View File
@@ -1,9 +0,0 @@
BUILD_DIR=/usr/local/build/bash/bash-20041216-gprof
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
export THIS_SH PATH
rm -f /tmp/xx
/bin/sh "$@"
-9
View File
@@ -1,9 +0,0 @@
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=ksh93
PATH=$PATH:$BUILD_DIR
export THIS_SH PATH
rm -f /tmp/xx
/bin/sh "$@"
-24
View File
@@ -1,24 +0,0 @@
echo ff{c,b,a}
echo f{d,e,f}g
echo {l,n,m}xyz
echo {abc\,def}
echo {abc}
echo \{a,b,c,d,e}
echo {x,y,\{a,b,c}}
echo {x\,y,\{abc\},trie}
echo /usr/{ucb/{ex,edit},lib/{ex,how_ex}}
echo XXXX\{`echo a b c | tr ' ' ','`\}
eval echo XXXX\{`echo a b c | tr ' ' ','`\}
echo {}
echo { }
echo }
echo {
echo abcd{efgh
echo foo {1,2} bar
echo `zecho foo {1,2} bar`
echo $(zecho foo {1,2} bar)
-49
View File
@@ -1,49 +0,0 @@
VAR='[[:alpha:]]'
[[ $VAR =~ '[[:alpha:]]' ]] && echo match 1
[[ a =~ '[[:alpha:]]' ]] || echo match 2
[[ a =~ [[:alpha:]] ]] && echo match 3
[[ a =~ $VAR ]] && echo match 4
[[ a =~ "$VAR" ]] || echo match 5
line=aab
[[ $line =~ [[:space:]]*(a)?b ]] && echo match 6
V="alphabet"
[[ $V == alphabet ]] && echo yes 1
[[ $V == "alphabet" ]] && echo yes 2
[[ $V == 'alphabet' ]] && echo yes 3
[[ $V =~ alphabet ]] && echo yes 4
[[ $V =~ "alphabet" ]] && echo yes 5
[[ $V =~ 'alphabet' ]] && echo yes 6
DOG="Dog name - 01 - Wiggles"
REPAT='([[:alpha:][:blank:]]*)- ([[:digit:]]*) - (.*)$'
if [[ $DOG =~ ([[:alpha:][:blank:]]*)-\ ([[:digit:]]*)\ -\ (.*)$ ]]
then
echo Dog ${BASH_REMATCH[2]} is ${BASH_REMATCH[3]}
fi
if [[ $DOG =~ $REPAT ]]
then
echo Dog ${BASH_REMATCH[2]} is ${BASH_REMATCH[3]}
fi
[[ $REPAT =~ "$REPAT" ]] && echo rematch 1
v="one two buckle my shoe"
[[ ${v} =~ "one two" ]] && echo matches 7
[[ ${v} =~ (one two) ]] && echo matches 8
[[ ${v} =~ one\ two ]] && echo matches 9
# problems in pre-patched bash-4.2
[[ "helloworld" =~ llo ]] && echo match control-a 1
[[ "helloworld" =~ world ]] && echo match control-a 2
[[ "helloworld" =~ world$ ]] && echo match control-a 3
[[ "helloworld" =~  ]] && echo match control-a 4
[[ "helloworld" =~ oworld$ ]] && echo match control-a 5
-48
View File
@@ -1,48 +0,0 @@
a()
{
cat <<-'+' | tr "\t" " " | tr -s " "
cat - | utkSort
itkSchemaToColumnType
atkCacheToColumnType \"$npName\" | atkActiveTableLineSelect
| utkSort
atkCacheToColumnType \"$npName\" |
atkTransactionTableLineSelect | utkSort
itkDirToColumnType \"$dirName\" | atkActiveTableLineSelect |
utkSort
itkDirToColumnType \"$dirName\" | atkActiveTableLineSelect |
utkSort
+
}
type a
b()
{
cat /etc/passwd | cat - <<-'+' | tr -s " "
more
passwords
from
the
file
+
}
type b
c()
{
cat /etc/passwd | tr -s " " | cat - <<-'+' | cat - <<-'foo'
more
passwords
from
the
file
+
last
bunch
of
words
foo
}
type c
-4
View File
@@ -1,4 +0,0 @@
1
2
3
4
-105
View File
@@ -1,105 +0,0 @@
if : ; then
set -e
N=95
while :; do
# expr returns 1 if expression is null or 0
set +e
N_MOD_100=`expr $N % 100`
set -e
echo $N_MOD_100
N=`expr $N + 1`
if [ $N -eq 110 ]; then
break
fi
done
set +e
fi
(
set -e
false
echo bad
)
echo $?
x=$(
set -e
false
echo bad
)
echo $? $x
# command subst should not inherit -e
set -e
echo $(false; echo ok)
if set +e
then
false
fi
echo hi
set -e
# a failing command in the compound list following a while, until, or
# if should not cause the shell to exit
while false; do
echo hi
done
echo while succeeded
x=1
until (( x == 4 )); do
x=4
done
echo until succeeded: $x
if false; then
echo oops
fi
echo if succeeded
# failing commands that are part of an AND or OR list should not
# cause the shell to exit
false && echo AND list failed
echo AND list succeeded
false || echo OR list succeeded
! false
echo ! succeeded
# make sure eval preserves the state of the -e flag and `!' reserved word
set -e
if eval false; then
echo oops
fi
echo eval succeeded
! eval false
echo ! eval succeeded -- 1
! eval '(exit 5)'
echo ! eval succeeded -- 2
set -e
until builtin false; do echo a; break; done
echo $?
until eval false; do echo b; break; done
echo $?
: ${TMPDIR:=/tmp}
FN=$TMPDIR/set-e-$$
cat > $FN << EOF
false
echo after 1
false
EOF
set -e
until . $FN; do echo a; break; done
echo $?
rm -f $FN
-66
View File
@@ -1,66 +0,0 @@
# this is needed because posix mode restricts tilde expansion to assignment
# statements preceding a command, instead of the default of expanding all
# assignment statements on the line (e.g., after `export'). Without this,
# the next-to-last test fails
set +o posix
HOME=/usr/xyz
SHELL=~/bash
echo ~ch\et
echo ~/"foo"
echo "~chet"/"foo"
echo \~chet/"foo"
echo \~chet/bar
echo ~\chet/bar
echo ~chet""/bar
echo ":~chet/"
echo abcd~chet
echo "SHELL=~/bash"
echo $SHELL
echo abcd:~chet
path=/usr/ucb:/bin:~/bin:~/tmp/bin:/usr/bin
echo $path
cd /usr
cd /tmp
echo ~-
echo ~+
XPATH=/bin:/usr/bin:.
# yes tilde expansion
PPATH=$XPATH:~/bin
echo "$PPATH"
# no tilde expansion
PPATH="$XPATH:~/bin"
echo "$PPATH"
# yes tilde expansion
export PPATH=$XPATH:~/bin
echo "$PPATH"
declare -x PPATH=$XPATH:~/bin
echo "$PPATH"
# no tilde expansion
export PPATH="$XPATH:~/bin"
echo "$PPATH"
declare -x PPATH="$XPATH:~/bin"
echo "$PPATH"
# more tests of tilde expansion when executing case commands
case ~ in
$HOME) echo ok 1;;
*) echo bad 1 ;;
esac
case ~ in
~) echo ok 2 ;;
\~) echo bad 2a ;;
*) echo bad 2b ;;
esac
case $unset in
"") echo ok 3 ;;
*) echo bad 3 ;;
esac