1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/bin/sh
Garance A Drosehn 5cc540d471 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
alias.h
arith_lex.l
arith.h
arith.y
builtins.def /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
cd.c
cd.h
error.c
error.h
eval.c
eval.h
exec.c Attempting to unset an undefined variable or function should not be 2004-09-27 18:43:18 +00:00
exec.h
expand.c
expand.h
histedit.c
init.h
input.c
input.h
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
mail.c
mail.h
main.c
main.h
Makefile
memalloc.c
memalloc.h
miscbltin.c
mkbuiltins /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
mkinit.c
mknodes.c
mksyntax.c
mktokens /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
myhistedit.h
mystring.c
mystring.h
nodes.c.pat
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
output.c
output.h
parser.c
parser.h
redir.c
redir.h
sh.1 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
shell.h
show.c
show.h
TOUR
trap.c
trap.h
var.c Attempting to unset an undefined variable or function should not be 2004-09-27 18:43:18 +00:00
var.h