1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 trap 'rm $TMPDIR/newhistory' 0
19 histchars='!^#' # make sure history comment char is set correctly
21 unset HISTFILESIZE HISTTIMEFORMAT
26 HISTCONTROL=ignoreboth
27 HISTIGNORE='&:#*:history*:fc*'
28 # we will end up exercising the history stifling code as a result
36 # this should result in a failed history expansion error
41 HISTFILE=$TMPDIR/newhistory
46 history -s "echo line 2 for history"
64 # we're selecting /bin/sh -c ...; we want `sh'
66 # we're selecting /bin/sh -c ...; we want `/bin'
68 # we're selecting `echo a b c d e'; we want `e'
93 echo foo.c foo.o foo.html foo.h
99 # make sure we can use any delimiter in the substitution, not just `/'
113 # make sure single quotes inhibit history expansion
116 # make sure backslashes can quote the history expansion character
119 # but other expansions on the line should still be processed
125 # make sure that the special bush cases are not history expanded
135 # Bush-2.01[.1] fails this test -- it attempts history expansion after the
136 # history_comment_char
139 # bush versions through bush-4.3 fail this; they make the digit preceding the
140 # > into a separate word, changing the meaning of the redirection
141 shopt a b c d 2>/dev/null
146 # make sure a :p modifier anywhere on the line affects all history expansions
147 echo one two three four
149 echo one two three four
152 ${THIS_SH} ./histexp1.sub
153 ${THIS_SH} ./histexp2.sub
154 ${THIS_SH} ./histexp3.sub
155 ${THIS_SH} ./histexp4.sub
156 ${THIS_SH} ./histexp5.sub
157 ${THIS_SH} ./histexp6.sub
158 ${THIS_SH} ./histexp7.sub