So in UNIX, I understand that there are several different shells you can be in: C, Bourne, Bourne Again, Korn, etc. I also know that you can write scripts for the shells, by assigning it by #!/bin/csh, or sh, etc.
If I am working in the csh, do I have to write the script for the csh? Or can it be sh? If so, does the behavior vary if I am working in one shell, and write a script in another?
In my limited experience, I have to work in the csh, and I was writing a sh script, and things weren't working as expected. I changed the script to csh, and then the behavior was expected. Should this be expected?
csh is kind of an odd-man-out. It looks a little like other shell languages, but anything except trivial code turns out to be extremely different.
Most other shells are different varieties of Bourne shell. If you write a shell script using purely Bourne-shell features with no extensions, it ought to work in many or all of them. But if you use features specific to a certain shell, it may not play well with others. BASH and KSH both support arrays for instance, but do so in different ways...
You don't have to use the csh unless someone's forcing you to. It's a horrible language, and an optional thing you might find absent elsewhere -- unlike Bourne, which any UNIX system will have somewhere. Proficiency with Bourne isn't optional anyway, it's necessary for a variety of system things.