I'm new to write shell script, and I looked at some tutorial on the Internet and now I try to write my first script, it's simple:
#! /bin/csh
echo "Hello World! \a \n"
exit 0
It looks simple and correct, it will show Hello World on my terminal, but it won't be terminated -- I need to ctrl+c to stop the shell.
But I try
#! /bin/sh
echo "Hello World! \a \n"
exit 0
This can be terminated normally, I know that first line is to specify what shell
you want to use to execute the script, and I used the set
command to find out my default shell is /bin/csh
Other users on this server are all ok. Does everyone know how can I fix the problem? I can't use some shell scripts written by my friend.