Imported from ../bash-2.01.tar.gz.
[platform/upstream/bash.git] / tests / history.tests
1 trap 'rm /tmp/newhistory' 0
2
3 history -c
4
5 HISTFILE=history.list
6 HISTCONTROL=ignoreboth
7 HISTIGNORE='&:history*:fc*'
8 HISTSIZE=32
9
10 shopt -s cmdhist
11 set -o history
12
13 history
14
15 fc -l
16 fc -nl
17
18 fc -lr
19 fc -nlr
20
21 history -s "echo line for history"
22 history
23
24 history -p '!!'
25
26 fc -nl
27
28 HISTFILE=/tmp/newhistory
29 history -a
30 echo displaying \$HISTFILE after history -a
31 cat $HISTFILE
32
33 history
34 history -w
35 cat $HISTFILE
36
37 history -s "echo line 2 for history"
38 history
39 history -p '!e'
40 history -p '!!'
41
42 # this should show up as one history entry
43 for x in one two three
44 do
45         :
46 done
47 history
48
49 # just a basic test.  a full test suite for history expansion should be
50 # created
51 set -H
52 !!
53 !e
54
55 unset HISTSIZE
56 unset HISTFILE
57
58 fc -l 4
59 fc -l 4 8
60
61 fc -l 502
62
63 history 4
64
65 shopt -so history
66 shopt -s expand_aliases
67
68 alias r="fc -s"
69
70 echo aa ab ac
71
72 r a=x
73
74 # this had better fail with `no command found'
75 r cc
76
77 unalias -a
78 alias
79
80 set +o history
81
82 shopt -q -o history
83 echo $?