Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / tests / execscript
index 09a4ba5..5a4e903 100644 (file)
@@ -12,6 +12,7 @@ echo calling exec1.sub
 echo after exec1.sub with args: $?
 ./exec1.sub
 echo after exec1.sub without args: $?
+echo after exec1.sub: "$@"
 
 # set up a fixed path so we know notthere will not be found
 PATH=/usr/bin:/bin:/usr/local/bin:
@@ -48,6 +49,8 @@ echo $?
 
 # try sourcing a binary file -- post-2.04 versions don't do the binary file
 # check, and will probably fail with `command not found', or status 127
+# bash-4.1 and later check for 256 NUL characters and fail as binary files
+# if there are more than that, it's probably binary
 . ${THIS_SH} 2>/dev/null
 echo $?
 
@@ -105,6 +108,20 @@ ${THIS_SH} ./exec6.sub
 # checks for properly deciding what constitutes an executable file
 ${THIS_SH} ./exec7.sub
 
+${THIS_SH} -i ./exec8.sub
+
+${THIS_SH} ./exec9.sub
+
 true | `echo true` &
 
 echo after
+
+# Problem with bash at least back to version 3.0
+${THIS_SH} -c 'VAR=0; VAR=1 command exec; exit ${VAR}'
+
+# problem with bash through bash-4.1
+(
+        exec /var/empty/nosuch
+        echo bad
+) 2>/dev/null
+[ $? = 127 ] || echo FAIL: bad exit status $? at $LINENO