freebsd-skq/bin/sh
gad 41238cc6d1 Change /bin/sh so *it* implements the processing needed for scripts to
work as expected when they have a "shebang line" of:

     #!/bin/sh -- # -*- perl -*- -p

This specific line is recommended in some perl documentation, and I think
I've seen similar lines in documentation for ruby and python.  Those
write-ups expect `sh' to ignore everything after the '--' if the first
thing after the '--' is a '#'.  See chapter 19, "The Command-Line Interface"
in 3rd edition of "Programming Perl", for some discussion of why perl
recommends using this line in some circumstances.

The above line does work on solaris, irix and aix (as three data points),
and it used to work on FreeBSD by means of a similar patch to execve().
However, that change to execve() effected *all* shells (which caused
other problems), and that processing was recently removed.

PR:		16393  (the original request to fix the same issue)
Reviewed by:	freebsd-current (looking at a slightly different patch)
MFC after:	1 week
2005-02-16 05:17:58 +00:00
..
bltin /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
funcs /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
alias.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
alias.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
arith_lex.l Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
arith.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
arith.y Include <stdio.h> for a sprintf() prototype. 2004-05-24 10:11:31 +00:00
builtins.def /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
cd.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
cd.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
error.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
error.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
eval.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
eval.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
exec.c Attempting to unset an undefined variable or function should not be 2004-09-27 18:43:18 +00:00
exec.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
expand.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
expand.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
histedit.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
init.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
input.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
input.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
jobs.c o Terminate an endless loop sh -T goes into in dowait() around waitproc(). 2004-12-02 13:12:43 +00:00
jobs.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mail.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mail.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
main.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
main.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
Makefile
memalloc.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
memalloc.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
miscbltin.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mkbuiltins /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
mkinit.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mknodes.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mksyntax.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mktokens /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
myhistedit.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mystring.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
mystring.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
nodes.c.pat Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
nodetypes /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
options.c Change /bin/sh so *it* implements the processing needed for scripts to 2005-02-16 05:17:58 +00:00
options.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
output.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
output.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
parser.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
parser.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
redir.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
redir.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
sh.1 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
shell.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
show.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
show.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
TOUR
trap.c Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
trap.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00
var.c Attempting to unset an undefined variable or function should not be 2004-09-27 18:43:18 +00:00
var.h Remove clause 3 from the UCB licenses. 2004-04-06 20:06:54 +00:00