: Hi
: I found the line command which can read line from user input with timeout
: but it work in Bourn shell so I can do it in C shell ??
: #!/bin/sh
: replyBefor=AA
: echo 'Enter string : \c'
: reply=`line -t 5`
: if [ "X" = "X$reply" ]
: then
: reply=$replyBefor
: fi
: echo
: echo replyBefor = $replyBefor
: echo "reply = $reply"
In general, people are going to tell you not to bother with Csh scripting,
especially when you are considering a problem that is non-trivial even in
bourne shell.
If "line" has a "-t" option on your system (I have never heard of such
a thing) that performs a timeout mechanism, one may command:
set input = (`line -t 5`)
Otherwise there is no mechanism either builtin or possible by a hack of
programming that may accomplish such a task, with the remedial I/O
features csh provides.
-Brian
--
,---. ,---. ,---. ,---. ,---. ,---. ,---.
/ _ \ / _ \ / _ \ / _ \ / _ \ / _ \ / _ \
__,' `.___,' `.___,' `.___,' `.___,' `.___,' `.___,' `.__