posted 22 years ago
Hello ,
I am writing a shell script in tcsh env. Have a prob.
Actuallly what I want to do is get a variable (Y/N) as input and then proceed...Have written
a function to do this ..pls correct me if I'm wrong.
Am getting this error message
"Badly places ()'s "
Pls help me out.
valid_string(){
while ( `echo "$1 \c" ` 1>&2 )
set name="$<"<br /> echo $name<br /> switch ( $name )<br /> case "" :<br /> echo "Nothing entered" 1>&2
continue
breaksw
default :
if ( `expr "$name" : '.*'` > $2 ) then
echo "Maximum $2 character(s) permitted" 1>&2
else
break
endif
breaksw
endsw
end
echo name
}
# Check the HBK process
set choice=`valid_string "Do you want to start the HBK process? (Y/N):" 1`