I'm trying to create a script to to do simple things. I need to prompt the user to reply to a question, typing yes or no. The script is written for csh, but does not work when default user shell is bash. My environment is Red Hat Enterprise Linux 5
#!/bin/csh -f
echo -n Type yes to continue
set answer = $<
#...
This code works fine with csh but not with bash where it prints the following error:
syntax error near unexpected token 'newline'
bash 'set answer =$<'
I really need to have the same script working for both shell (I thought it was the purpose of putting #!/bin/csh
at the beginning of the file!)
I don't really know how to modify my script to make it working in bash. Could you help me please? Thanks a lot for your help.