sending stdout and stderr to a file

working on a c sell script

I think I understand the concept of it, which is:

filename >> file.txt (to appaend)

or filename | tee -a file.txt (to append)

The problem is that my shell script is used with several parameters, and these commands don't seem to work with just filename. They both get a blank screen where I can type whatever until I quit, with nohing saved to file.txt

All the tutorials I googled don't mention parameters, so I don't know what to do

help!
thanks!

Assuming program-name is executable and in your path... this
should work just fine. Notice the redirection since your subject says you want both stdout and stderr to the output file.

program-name arg1 arg2 arg3 >& both-stdout-stderr-here.txt

Top Ten Reasons not to use the C shell
Csh problems
Csh Programming Considered Harmful