Cshell input from bash
Using
csh
you start a new subshell where your script is not being executed. Therefore, none of your next commands are executed. Your script is waiting for this subshell to finish, which you have noticed will never happen.
Try
csh -c "echo in_cshell"
This way you are not creating a new subshell that your script is not affected by.
source to share
By simply calling csh
the script, you will start an interactive csh session. You will notice that after exiting the session, csh
your script will continue with subsequent echoing and quiting on exit
.
To pass a sequence of commands csh
from you to a bash script, one way would be to use the Here Document syntax to redirect commands to csh
.
#!/bin/bash
echo entering_to_cshell
csh <<EOF
echo in_cshell
exit
EOF
echo exited_from_cshell
Lines between EOF records will be processed as script which are interpreted csh
.
source to share