mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-09 19:50:32 +02:00
commit bash-20040802 snapshot
This commit is contained in:
+3
-5
@@ -1,7 +1,6 @@
|
||||
./type.tests: line 9: type: -r: invalid option
|
||||
type: usage: type [-afptP] name [name ...]
|
||||
./type.tests: line 12: type: notthere: not found
|
||||
./type.tests: line 13: command: notthere: not found
|
||||
function
|
||||
keyword
|
||||
builtin
|
||||
@@ -25,8 +24,7 @@ func ()
|
||||
}
|
||||
while
|
||||
while is a shell keyword
|
||||
./type.tests: line 42: type: m: not found
|
||||
./type.tests: line 43: command: m: not found
|
||||
./type.tests: line 43: type: m: not found
|
||||
alias m='more'
|
||||
alias m='more'
|
||||
m is aliased to `more'
|
||||
@@ -39,8 +37,8 @@ builtin
|
||||
builtin is a shell builtin
|
||||
/bin/sh
|
||||
/bin/sh is /bin/sh
|
||||
./type.tests: line 64: type: func: not found
|
||||
./type.tests: line 66: type: m: not found
|
||||
./type.tests: line 65: type: func: not found
|
||||
./type.tests: line 67: type: m: not found
|
||||
/bin/sh
|
||||
/tmp/bash
|
||||
bash is hashed (/tmp/bash)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
./type.tests: line 9: type: -r: invalid option
|
||||
type: usage: type [-afptP] name [name ...]
|
||||
./type.tests: line 12: type: notthere: not found
|
||||
function
|
||||
keyword
|
||||
builtin
|
||||
file
|
||||
file
|
||||
file
|
||||
func is a function
|
||||
func ()
|
||||
{
|
||||
echo this is func
|
||||
}
|
||||
while is a shell keyword
|
||||
while is a shell keyword
|
||||
builtin is a shell builtin
|
||||
/bin/sh is /bin/sh
|
||||
func
|
||||
func is a function
|
||||
func ()
|
||||
{
|
||||
echo this is func
|
||||
}
|
||||
while
|
||||
while is a shell keyword
|
||||
./type.tests: line 42: type: m: not found
|
||||
alias m='more'
|
||||
alias m='more'
|
||||
m is aliased to `more'
|
||||
alias
|
||||
alias m='more'
|
||||
alias m='more'
|
||||
alias m='more'
|
||||
m is aliased to `more'
|
||||
builtin
|
||||
builtin is a shell builtin
|
||||
/bin/sh
|
||||
/bin/sh is /bin/sh
|
||||
./type.tests: line 64: type: func: not found
|
||||
./type.tests: line 66: type: m: not found
|
||||
/bin/sh
|
||||
/tmp/bash
|
||||
bash is hashed (/tmp/bash)
|
||||
file
|
||||
hits command
|
||||
3 /tmp/bash
|
||||
1 /bin/sh
|
||||
+2
-1
@@ -36,7 +36,8 @@ command -V func
|
||||
command -v while
|
||||
command -V while
|
||||
|
||||
# the following three lines should produce the same output
|
||||
# the following two lines should produce the same output
|
||||
# post-3.0 patch makes command -v silent, as posix specifies
|
||||
# first test with alias expansion off (should all fail or produce no output)
|
||||
type -t m
|
||||
type m
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
set +o posix
|
||||
|
||||
hash -r
|
||||
unalias -a
|
||||
|
||||
# this should echo nothing
|
||||
type
|
||||
# this should be a usage error
|
||||
type -r ${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 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 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
|
||||
# first test with alias expansion off (should all fail or produce no output)
|
||||
type -t m
|
||||
type m
|
||||
command -v m
|
||||
alias -p
|
||||
alias m
|
||||
|
||||
# then test with alias expansion on
|
||||
shopt -s expand_aliases
|
||||
type m
|
||||
type -t m
|
||||
command -v m
|
||||
alias -p
|
||||
alias m
|
||||
|
||||
command -V m
|
||||
shopt -u expand_aliases
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user