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