Nice command but how it can work in csh

Nice command but how it can work in csh

Post by INGRP Eli Sheena 522 » Wed, 20 Nov 1996 04:00:00



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 ??

Here an example

#!/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"

Thanks
   Eli Sheena

 
 
 

Nice command but how it can work in csh

Post by Brian S Hil » Wed, 20 Nov 1996 04:00:00



: 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
--
   ,---.     ,---.     ,---.     ,---.     ,---.     ,---.     ,---.  
  /  _  \   /  _  \   /  _  \   /  _  \   /  _  \   /  _  \   /  _  \  

__,'   `.___,'   `.___,'   `.___,'   `.___,'   `.___,'   `.___,'   `.__

 
 
 

Nice command but how it can work in csh

Post by Jonathan Ch » Sat, 23 Nov 1996 04:00:00



Quote:>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 ??

It's *always* safer to do all your scripts in Bourne shell to ensure
greater compatibility. UNIX vendor's respective csh always tend to
differ in minor and irritating ways.
--

 
 
 

1. Nice. Nice nice nice.

So I'd heard about this Linux thing - let's face it, you can't spend
any more than a year online and NOT hear about it unless you're under
some cybernetic rock - and always felt I ought to give it a try at
some point. Picked up the friendly yellow 'For Dummies' book which
came with three CDs of RH7.0. Lots of nice hand-holding throughout the
install process (which got me safely through a major glitch when the X
installer, starting up reasonably enough in a no-risk 640x480, got the
screen geometry totally wrong and was illegible, and pointed me in the
right direction for LOADLIN when lilo couldn't cope with Linux being
at the back end of a big drive) and I soon got into the OS. Got it
online, no worries. Well, this is nice, I said to myself, but
eventually I largely forgot about the system lurking at the other end
of my drive and returned through force of habit to Windows95.

But not willing to just plain give up (there's a principle involved,
dammit!) I sent off for the RH7.2 CDs when it came out. Fifteen quid.
Well, bugger me sideways... this new KDE is seriously slick, it just
*feels* faster, smoother, the lot. I'd imagine a lot of the discussion
of new distributions on here centres on technical aspects of kernels
and so forth, but speaking as a Windows refugee fleeing the imminent
prospect of XP's Big Brother pirate protection, it's looking like
Linux can become a happy home.

So much so, in fact, that I'm planning on getting myself a new
computer in a year or so, and having whatever the latest RH Linux is
as the main OS. Bill's not seeing another penny if I can help it...
(he says, posting with a Hotmail address in a slightly embarrassed
tone)

Odds are a fair number of people reading had some input into this nice
new OS I'm using now, so I just have to say, thanks guys.

2. How to setup Sun Servers to Page me

3. nice command not working !

4. Running scripts through sbox... How can I make it transparent?

5. csh commands within csh scripts

6. Is there a Gopher in linux?

7. Why doesn't this csh command work on HP-UX 10.20???

8. Sharing memory with pthread

9. Q: Why doesn't this CSH command work???

10. csh with a command on the command line

11. SUMMARY: To "nice" or not to "nice" [LONG]

12. "Nice" or not to "nice" large jobs

13. So what's so nice about nice()?