shebang line parsing changes in 6.0

Daniel Rench drench at gmail.com
Thu Dec 15 11:44:54 PST 2005


I upgraded a test box to 6.0 recently and various things broke, all
related to the shebang line parsing changes (see:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/imgact_shell.c ).

I found the "historical" parsing behavior really, really useful. Like
if I wanted a script to always run as a particular user, I'd use
"#!/usr/local/bin/sudo -u someuser /bin/sh", or if I wanted  to ensure
only one copy of a script ran at a time, "#!/usr/local/bin/setlock
/some/lock/file /bin/sh" (using setlock from the daemontools package),
etc.

I guess I could write a program to split argv[1] on whitespace and
exec, but is there a simpler way to work around this?


More information about the freebsd-questions mailing list