script question
Steven M. List
itkin at mrspoc.Transact.COM
Fri Apr 12 08:29:29 AEST 1991
pfinkel at cbnewsb.cb.att.com (paul.d.finkel) writes:
>In article <1991Apr10.144150.10011 at cbfsb.att.com> pfinkel at cbnewsb.cb.att.com (paul.d.finkel) writes:
>>In article <1991Apr3.165501.25434 at rodan.acs.syr.edu> ldstern at rodan.acs.syr.edu (Larry Stern) writes:
>>>I have a simple script question I can't seem to get answered here. I would
>>>like my .login file to ask me if I want to read news, something to the effect
>>>of:
>>> Read new (y/n)?
>>> if "y" then rn -s15
>>> else [prompt]
>>
>>How about:
>>
>> echo "Read news[CR=y/n]? \c"
>> read ans
>> if [ "$ans" = "" ]
>> then
>> news
>> else
>> :
>> fi
>>
>
>Sorry, it could have been
>
> echo "Read news[CR=yes/n] \c"
> read ans
> if [ ! "$ans" ]
>
> etc,etc.
How about if he said ".login" assuming that it must be the C shell?
/bin/echo "Read news (y/n) [y] \c"
set reply = `line`
if ( "$reply" == "y" || "$reply" == "" ) then
rn...
endif
--
+----------------------------------------------------------------------------+
: Steven List @ Transact Software, Inc. :^>~ :
: Chairman, Unify User Group of Northern California :
: itkin at Transact.COM :
More information about the Comp.unix.questions
mailing list