Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!think.com!mintaka!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.wizards Subject: Re: using #! and a different shell Message-ID: <1991Feb22.013533.24299@athena.mit.edu> Date: 22 Feb 91 01:35:33 GMT References: <1991Feb21.172233.8160@aplcen.apl.jhu.edu> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 32 % cat echo-args.c #include main(int argc, char *argv[]) { if (! argc) { printf("There are no arguments.\n"); } else { printf("The arguments are:"); while (argc--) { printf(" %s", *argv++); } printf("\n"); } exit(0); } % cat use-echo-args #!/tmp/echo-args exit 0 % ./use-echo-args foo bar baz The arguments are: echo-args ./use-echo-args foo bar baz This is on BSD 4.3; I doubt it's significantly different on other platforms that allow #!. I guess this is why "#!/bin/awk -f" works. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710 Brought to you by Super Global Mega Corp .com