Article View: comp.unix
Article #160Shell scripts starting with "#"
From: Dan Farmer
Date: Fri, 13 Jul 1990 21:13
Date: Fri, 13 Jul 1990 21:13
19 lines
1149 bytes
1149 bytes
[Moderators Note:-
To save a deluge of mail and postings, the answer is to
put a ':' by itself on line one of the script. For example;
:
# This is the second line of a bourne-shell script.
This may not work on absolutely *every* variant, but it should cover most.
- Der]
Does System V (or some versions of Sys V, or any version of the Un*x,
for that matter) execute a shell script under csh if it begins with a
"#" (for instance if you explicitly say "#!/bin/sh")? I've been told
this, but can't confirm it....
If this is true, what is the best portable way to always have a script
execute under /bin/sh? (don't say "/bin/sh script"....)
thanks,
- dan
df@sei.cmu.edu
Technical Details
Message-ID:
<3695@zorba.Tynan.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!zorba!dtynanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!zorba!dtynan From: df@sei.cmu.edu (Dan Farmer) Newsgroups: comp.unix Subject: Shell scripts starting with "#" Keywords: sys v Message-ID: <3695@zorba.Tynan.COM> Date: 13 Jul 90 21:13:42 GMT Sender: dtynan@zorba.Tynan.COM Organization: Carnegie-Mellon University (Software Engineering Institute), Pgh, PA Lines: 19 Approved: dtynan@zorba.Tynan.COM