5 echo before exec1.sub: "$@"
7 ./exec1.sub aa bb cc dd ee
8 echo after exec1.sub with args: $?
10 echo after exec1.sub without args: $?
12 # set up a fixed path so we know notthere will not be found
13 PATH=/usr/bin:/bin:/usr/local/bin:
19 # this is iffy, since the error messages may vary from system to system
23 # /bin/sh should be there on all systems
27 # try executing a directory
34 # try sourcing a directory
38 # try sourcing a binary file -- post-2.04 versions don't do the binary file
39 # check, and will probably fail with `command not found', or status 127
40 . ${THIS_SH} 2>/dev/null
46 # kill two birds with one test -- test out the BASH_ENV code
47 echo echo this is bashenv > /tmp/bashenv
48 export BASH_ENV=/tmp/bashenv
49 ${THIS_SH} ./exec3.sub
53 # we're resetting the $PATH to empty, so this should be last
65 # but -p should guarantee that we find all the standard utilities, even
66 # with an empty or unset $PATH
67 command -p sh -c 'echo this is $0'
69 command -p sh -c 'echo this is $0'
71 # a bug in bash before bash-2.01 caused PATH to be set to the empty string
72 # when command -p was run with PATH unset
75 echo "echo ok" | ${THIS_SH} -t
77 ${THIS_SH} ./exec2.sub
80 ${THIS_SH} ./exec4.sub
82 # try exec'ing a command that cannot be found in $PATH
83 ${THIS_SH} ./exec5.sub
85 # this was a bug in bash versions before bash-2.04
86 ${THIS_SH} -c 'cat </dev/null | cat >/dev/null' >&-
88 # checks for proper return values in subshell commands with inverted return
91 ${THIS_SH} ./exec6.sub