File: type.tests

package info (click to toggle)
bash 2.05a-11
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,804 kB
  • ctags: 6,165
  • sloc: ansic: 67,305; sh: 10,832; perl: 4,105; yacc: 3,166; makefile: 3,075; asm: 48; awk: 23
file content (68 lines) | stat: -rw-r--r-- 947 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
set +o posix

hash -r
unalias -a

# this should echo nothing
type
# this should be a usage error
type -f ${THIS_SH}

# these should behave identically
type notthere
command -v notthere

alias m=more

unset -f func 2>/dev/null
func() { echo this is func; }

type -t func
type -t while
type -t m
type -t builtin
type -t /bin/sh
type -t ${THIS_SH}
type -t mv

type func
# the following two should produce identical output
type while
type -a while
type m
type builtin
type /bin/sh

command -v func
command -V func
command -v while
command -V while
# the following three lines should produce the same output
command -v m
alias -p
alias m
command -V m
command -v builtin
command -V builtin
command -v /bin/sh
command -V /bin/sh

unset -f func
type func
unalias m
type m

hash -r

hash -p /bin/sh sh
type -p sh

SHBASE=${THIS_SH##*/}
hash -p /tmp/$SHBASE $SHBASE
type -p $SHBASE
type $SHBASE

type -t $SHBASE

# make sure the hash table looks right
hash