]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/history4.sub
a6bfd33f9be0c1d24603435350953dff4b67c057
[thirdparty/bash.git] / tests / history4.sub
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.
5 #
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.
10 #
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/>.
13 #
14 HISTFILE=$TMPDIR/newhistory-$$
15 export HISTFILE
16
17 HISTSIZE=32
18 HISTFILESIZE=32
19 echo
20 set -o history
21 history -c
22 echo 0
23 echo 1
24 echo 2
25 echo "(left
26 mid
27 right)"
28 echo A
29 echo B
30 history -w
31 set +o history
32
33 echo
34 printf $'HISTFILE=\n\cRleft\cO\cO\cO\cO\n' | HISTSIZE= ${THIS_SH} --norc -i 2>/dev/null
35 echo
36 printf $'HISTFILE=\n\cRleft\cO\cO\cO\cO\n' | HISTSIZE=8 ${THIS_SH} --norc -i 2>/dev/null
37
38 input="$(cat $HISTFILE)
39 "$'\cP\cP\cP\cO\cO
40 '
41
42 echo
43 printf "$input" | HISTSIZE= HISTFILE= ${THIS_SH} --norc -i 2>/dev/null
44 echo
45 printf "$input" | HISTSIZE=6 HISTFILE= ${THIS_SH} --norc -i 2>/dev/null
46