[comp.unix.questions] Why #!/bin/[c]sh?

walkera@egg.gg.caltech.edu (Walker Aumann) (06/30/91)

I recently needed to use one command many times with one parameter, namely:
find <username> -user <username> -exec chgrp newgroup {} \;

When I typed the line in explicitly, or set things up to look for group and use . in
place of the first username, it worked fine, but even the script

find . -group oldgroup -print

failed to return anything.  That is, until I added the magic line #!/bin/csh to the
beginning.  

For background, I was logged in as a user, su'ed, and running csh (with the user .login
and .cshrc).  (Please, no security flames - I'm still working on that)  Running which
said that there were no conflicts with the script name, or find (i.e. I was running what
I thought I was running).

So I know the fix for the problem I had, but why, and what does this line do?

Walker Aumann
walkera@maggot.gg.caltech.edu