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.
system
September 9, 2007, 3:01am
3
read will not work in csh.
use the following command to read from stdin in csh,
set req = $<
All the best with CSH