1set +o posix
2
3hash -r
4unalias -a
5
6# this should echo nothing
7type
8# this should be a usage error
9type -r ${THIS_SH}
10
11# these should behave identically
12type notthere
13command -v notthere
14
15alias m=more
16
17unset -f func 2>/dev/null
18func() { echo this is func; }
19
20type -t func
21type -t while
22type -t builtin
23type -t /bin/sh
24type -t ${THIS_SH}
25type -t mv
26
27type func
28# the following two should produce identical output
29type while
30type -a while
31type builtin
32type /bin/sh
33
34command -v func
35command -V func
36command -v while
37command -V while
38
39# the following two lines should produce the same output
40# post-3.0 patch makes command -v silent, as posix specifies
41# first test with alias expansion off (should all fail or produce no output)
42type -t m
43type m
44command -v m
45alias -p
46alias m
47
48# then test with alias expansion on 
49shopt -s expand_aliases
50type m
51type -t m
52command -v m
53alias -p
54alias m
55
56command -V m
57shopt -u expand_aliases
58
59command -v builtin
60command -V builtin
61command -v /bin/sh
62command -V /bin/sh
63
64unset -f func
65type func
66unalias m
67type m
68
69hash -r
70
71hash -p /bin/sh sh
72type -p sh
73
74SHBASE=${THIS_SH##*/}
75hash -p /tmp/$SHBASE $SHBASE
76type -p $SHBASE
77type $SHBASE
78
79type -t $SHBASE
80
81# make sure the hash table looks right
82hash
83