]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/history5.sub
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / history5.sub
CommitLineData
8868edaf
CR
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
15trap 'rm -f "$OUT"' 0 1 2 3 6 15
16
17HISTFILE=$TMPDIR/fchist-$$ ; OUT=$HISTFILE
18unset HISTIGNORE HISTCONTROL
19set -o history
20
21echo a
22echo b
23
24fc -0 # error
25fc -s -0 # error
26
27fc -l
28
29echo c
30fc -l 0
31fc -l -0
32
33echo d
34fc -s 0
35
36HISTSIZE=4
37history -c
38
39echo a
40echo b
41echo c
42echo d
43echo e
44echo f
45fc -l
46
47echo out of range 1
48fc -l 502 498
49echo out of range 2
50fc -l 498 502
51echo out of range 3
52fc -l 1 99
53# other out-of-range behavior for future work
54echo out of range 4
55fc -l -20 -40
56
57unset HISTFILE # suppress writing history file