Imported from ../bash-2.01.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
27 type func
28 # the following two should produce identical output
29 type while
30 type -a while
31 type m
32 type builtin
33 type /bin/sh
34
35 command -v func
36 command -V func
37 command -v while
38 command -V while
39 # the following three lines should produce the same output
40 command -v m
41 alias -p
42 alias m
43 command -V m
44 command -v builtin
45 command -V builtin
46 command -v /bin/sh
47 command -V /bin/sh
48
49 unset -f func
50 type func
51 unalias m
52 type m
53
54 hash -p /bin/sh sh
55 type -p sh
56
57 SHBASE=${THIS_SH##*/}
58 hash -p /tmp/$SHBASE $SHBASE
59 type -p $SHBASE
60 type $SHBASE