Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!munnari.oz.au!brolga!ggm From: ggm@brolga.cc.uq.oz.au (George Michaelson) Newsgroups: comp.unix.shell Subject: read in /bin/sh appears to be VERY cpu costly. Message-ID: <1991May8.013013.29811@brolga.cc.uq.oz.au> Date: 8 May 91 01:30:13 GMT Organization: Prentice Computer Centre, The University of Queensland, Australia. Lines: 29 I have written a very crude shellscript to do while loops over a read command. This is to permit a user attached to a terminal that cannot do control characters (!) to get access to unix and do some useful stuff with MH and editors. I have just found out she incurred around 300 seconds of CPU time on a sun 4 in 1 login session. simple tests using time on a shellscript of: while 1 do read INP echo $INP done seem to suggest that read is incredibly expensive on the CPU. Is this true, and is there any "cheaper" way to do interactive input from a terminal within shellscripts? Is this a "feature" in SunOS 4.1.1 /bin/sh? -George -- G.Michaelson Internet: G.Michaelson@cc.uq.oz.au Phone: +61 7 365 4079 Postal: George Michaelson, the Prentice Centre, The University of Queensland, St Lucia, QLD Australia 4072.