Subject: Re: /etc/rc with #!/bin/sh ?
To: David Maxwell <david@fundy.ca>
From: Gandhi woulda smacked you <greywolf@starwolf.com>
List: current-users
Date: 06/23/1999 10:01:56
On Wed, 23 Jun 1999, David Maxwell wrote:

# Sorry, I'm confused. I think you're saying that init calls rc using sh
# no matter what's at the top, and asking if we should teach it to use
# magic?

No, I'm saying "init calls rc using sh no matter what the top line".

My wondering about magic is something entirely different.

# > Does our file(1) need a better algorithm, or would that be nuts given that
# > there are quite a few shell scripts with enough filler in comments
# > to force it to rely on the #! line?  (probably this is the case).
# 
# It might be interesting to allow file to read a second line, if the
# first line is #!/bin/sh, and if the second line is a comment, use that
# as part of the description...

Not without an option, methinks.  I think it'd break compatibility with other
versions of file (...is this even worth thinking about?  I don't know.).

# That would give
# 1) The ability to file /etc/* |  grep Bourne | something

I think that #!.+/bin/sh should magic to Bourne shell commands,
that #!.+/csh should magic to C shell commands, that #!.+/perl should
magic to Perl script (or something...).  That doesn't sound terribly
difficult...

# 2) The ability to execute /etc/rc (provided you chmod +x)

You can execute rc:  sh /etc/rc.  I know this is not what you had in mind,
but it's certainly exactly what happens.  If it's not good enough, alias it.

# 3) The longer description for the sake of being prettier.

Hey, we're all competent folks here.  Pretty is nice, but should be an
option over functionality.

# David Maxwell, david@vex.net|david@maxwell.net -->
# (About an Amiga rendering landscapes) It's not thinking, it's being artistic!