Accepting user input in c shell

i need to accept the user input in my c shell script before executing next command. i have the following code which ask for user input, but does not store this value.

set req

echo " Enter your input(Y/N)?"
read req

if (req = Y)
echo " print $req"
else
echo " print $req"
endif

Where is the problem here. Pl. let me know.

I forget to mention the initial part of code i.e.
# !/bin/csh -f

ande after running it gives the output

print

if i remove set req, it give message like
req variable not found.

Pl.give some solution asap.

read will not work in csh.

use the following command to read from stdin in csh,

set req = $<

All the best with CSH :slight_smile:

It works. Thanks.