using #! and a different shell

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Fri Feb 22 08:00:56 AEST 1991


In article <1991Feb21.172233.8160 at aplcen.apl.jhu.edu> kjh at visual1.jhuapl.edu (Kenneth J. Heeres) writes:
> If I am writing my own shell command processor and I use the
>   #! pathname 
> capability to implicitly invoke it, what happens to the arguments that
> were passed to the script???

1. Your subject line is nearly useless. ``Using #!'' is too general, and
``a different shell'' is irrelevant. Much better would be

  Subject: With #!pathname, what happens to the args passed to the script?

Always put as much information as possible into the subject line.

2. You didn't say what system you're using. For some questions it won't
matter---#!, for example, is a BSD feature, and your question has the
same answer under any BSD system. Also, anyone on the Internet can use
the domain name server or telnet to find out your host type. But your
next question may be Ultrix-specific, the name server is unreliable
enough with its current load, and a lot of USENET readers aren't on the
Internet.

Always give at least a minimal description of your environment.

3. Your article is in the wrong group. Do you think that you have enough
experience to judge whether a question will catch the interest of any
wizards? Probably not. Have you seen the group ``comp.unix.questions''?
Why don't you use it if you want to ask a question about UNIX?

Always try comp.unix.questions first unless you know your article is
more appropriate in another group.

4. There is almost certainly someone at Johns Hopkins who can answer
your question. It is easier to mail a question to root or your favorite
sysadmin than to post to the net. Always try local resources before
bothering thousands of people around the world.

5. You can probably answer the question by experimentation. Presumably
you have some program that depends on the behavior you asked about, so
why don't you test it for yourself?

6. The answer appears in the execve() man page on every BSD system I've
seen. Read the fucking manual.

7. The arguments are placed on the command line after the #!.

---Dan



More information about the Comp.unix.wizards mailing list