Why #!/bin/[c]sh?

Walker Aumann walkera at egg.gg.caltech.edu
Sun Jun 30 05:09:39 AEST 1991


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 at maggot.gg.caltech.edu



More information about the Comp.unix.questions mailing list