Imported from ../bash-2.02.tar.gz.
[platform/upstream/bash.git] / tests / type.tests
1 set +o posix
2
3 hash -r
4 unalias -a
5
6 # this should echo nothing
7 type
8 # this should be a usage error
9 type -f ${THIS_SH}
10
11 # these should behave identically
12 type notthere
13 command -v notthere
14
15 alias m=more
16
17 unset -f func 2>/dev/null
18 func() { echo this is func; }
19
20 type -t func
21 type -t while
22 type -t m
23 type -t builtin
24 type -t /bin/sh
25 type -t ${THIS_SH}
26 type -t mv
27
28 type func
29 # the following two should produce identical output
30 type while
31 type -a while
32 type m
33 type builtin
34 type /bin/sh
35
36 command -v func
37 command -V func
38 command -v while
39 command -V while
40 # the following three lines should produce the same output
41 command -v m
42 alias -p
43 alias m
44 command -V m
45 command -v builtin
46 command -V builtin
47 command -v /bin/sh
48 command -V /bin/sh
49
50 unset -f func
51 type func
52 unalias m
53 type m
54
55 hash -r
56
57 hash -p /bin/sh sh
58 type -p sh
59
60 SHBASE=${THIS_SH##*/}
61 hash -p /tmp/$SHBASE $SHBASE
62 type -p $SHBASE
63 type $SHBASE
64
65 type -t $SHBASE
66
67 # make sure the hash table looks right
68 hash