source: vendor/bash/3.1-p17/tests/history.tests

Last change on this file was 3228, checked in by bird, 18 years ago

bash 3.1

File size: 1.2 KB
Line 
1trap 'rm /tmp/newhistory' 0
2
3# bad options
4history -x
5# cannot use -r and -w at the same time
6history -r -w /dev/null
7
8# bad option
9fc -v
10
11unset HISTFILESIZE
12
13# all of these should result in an empty history list
14history -c
15history -r /dev/null
16history -n /dev/null
17history -c
18
19HISTFILE=history.list
20HISTCONTROL=ignoreboth
21HISTIGNORE='&:history*:fc*'
22HISTSIZE=32
23
24shopt -s cmdhist
25set -o history
26
27history
28
29fc -l
30fc -nl
31
32fc -lr
33fc -nlr
34
35history -s "echo line for history"
36history
37
38history -p '!!'
39
40fc -nl
41
42HISTFILE=/tmp/newhistory
43history -a
44echo displaying \$HISTFILE after history -a
45cat $HISTFILE
46
47history
48history -w
49cat $HISTFILE
50
51history -s "echo line 2 for history"
52history
53history -p '!e'
54history -p '!!'
55
56# this should show up as one history entry
57for x in one two three
58do
59 :
60done
61history
62
63# just a basic test. a full test suite for history expansion should be
64# created
65set -H
66!!
67!e
68
69unset HISTSIZE
70unset HISTFILE
71
72fc -l 4
73fc -l 4 8
74
75fc -l one=two three=four 502
76
77history 4
78
79shopt -so history
80shopt -s expand_aliases
81
82alias r="fc -s"
83
84echo aa ab ac
85
86r a=x
87r x=4 b=8
88
89# this had better fail with `no command found'
90r cc
91
92unalias -a
93alias
94
95set +o history
96
97shopt -q -o history
98echo $?
Note: See TracBrowser for help on using the repository browser.