5 Jun 2010 18:06
debian patches to exit with code 127 for nonexistent/directory scripts
Jilles Tjoelker <jilles <at> stack.nl>
2010-06-05 16:06:51 GMT
2010-06-05 16:06:51 GMT
Debian's dash package has some local changes which cause an exit with code 127, as required by POSIX, if a script (passed with dash <filename>) cannot be opened or cannot be read because it is a directory. Unfortunately, these patches also affect the . builtin (if the pathname contains a slash) and use EXEXIT, which means such errors always cause the shell to exit, even in interactive mode or if the builtin's specialness has been disabled using command. % dash $ . ./nonexistent .: 1: Can't open ./nonexistent zsh: exit 127 dash % % dash -c 'command . ./nonexistent; echo continued' Note: Do not compare this with bash. Bash deliberately does not follow POSIX XCU 2.8.1 Consequences of Shell Errors if not in POSIX mode, and even in POSIX mode trying to source a nonexistent dot script (without slash in the pathname) fails to abort the shell. Note 2: POSIX seems unclear about what 'command .' should do, but is very clear that failure to find/read a dot script shall not cause an interactive shell to exit. -- -- Jilles Tjoelker --(Continue reading)
RSS Feed