arvindishukla 0 Newbie Poster

Hi All,
Below is little bit of code, which i'm unable to run,
#!/bin/csh
echo answer = ""
echo " Please enter x to exit from script and anyother character to continue"
read answer
if ( "$answer" = "x" )
then
echo "Exiting from the $0 script, please the error log file."
$return_code = 0
exit $return_code
fi

It giving error as "answer: Undefined variable".
My login shell is "tcsh"

THanks in advance for your help.

Regards,
Arvind S.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.