Public bug reported:
Binary package hint: dash
Shell scripts that do not have an explicit signature, that is have a blank
first line should be executed using the default shell. When dash is
installed as the default shell this doesn't happen, unless the current
directory is the one containing the script. For instance:
------
# First line should be blank, see execl(3).
echo "No signature script"
exit
------
does not execute when located on the PATH:
$ default_script.sh
/bin/sh: Can't open default_script.sh
cd to directory containing script:
$ cd bin
$ default_script.sh
No signature script
switch to bash, Solaris sh, Tru64 UNIX sh etc. all work.
In support of this (odd usage) I offer that the linux execl(3) man page
says:
"If the header of a file isn’t recognized (the attempted execve()
returned ENOEXEC), these functions will execute the shell with the path
of the file as its first argument. (If this attempt fails, no further
searching is done.)"
Similar statements are found in the single UNIX specification of execl, and the
comments in the original scripts say (without justification) that this is
the POSIX behaviour (and avoids the need to know where the standard
shell is installed).
$ dpkg-query -s dash
Installed-Size: 204
Architecture: i386
Version: 0.5.3-3ubuntu4
** Affects: dash (Ubuntu)
Importance: Undecided
Status: Unconfirmed
--
dash doesn't execute no signature scripts
https://launchpad.net/bugs/82490
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs