script question
James Cameron
jc at raven.bu.edu
Thu Apr 4 06:32:59 AEST 1991
>>>>> On 3 Apr 91 16:55:01 GMT, ldstern at rodan.acs.syr.edu (Larry Stern) said:
Larry> I have a simple script question I can't seem to get answered here. I would
Larry> like my .login file to ask me if I want to read news, something to the effect
Larry> of:
Larry> Read new (y/n)?
Larry> if "y" then rn -s15
Larry> else [prompt]
Larry> Thanks in advance for any help.
Larry> -Larry Stern
What you would want to do is to read the manual page with the shell you are running.
But, if you are using csh or tcsh, try this:
echo -n "Read news now? (Y/N): "
set REPLY = $<
if ($REPLY == "Y" || $REPLY == "y") then
rn -s15
endif
Hope that helps.
--
-- James Cameron (jc at raven.bu.edu)
Signal Processing and Interpretation Lab. Boston, Mass (617) 353-2879
------------------------------------------------------------------------------
"But to risk we must, for the greatest hazard in life is to risk nothing. For
the man or woman who risks nothing, has nothing, does nothing, is nothing."
(Quote from the eulogy for the late Christa McAuliffe.)
More information about the Comp.unix.questions
mailing list