Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!bionet!ucselx!nash From: nash@ucselx.sdsu.edu (Ron Nash) Newsgroups: comp.unix.programmer Subject: Re: get character without waiting Message-ID: <1991Jun18.164144.12769@ucselx.sdsu.edu> Date: 18 Jun 91 16:41:44 GMT References: <1991Jun12.001056.24021@watdragon.waterloo.edu> <1991Jun15.205136.4545@thunder.mcrcim.mcgill.edu> Organization: San Diego State University Computing Services Lines: 30 mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes: >In article <1991Jun12.001056.24021@watdragon.waterloo.edu>, nkkwan@crocus.uwaterloo.ca writes: >> How can I check whether there is character waiting in standard input >> or not? >The only real answer is "there is no portable way". Depending on >precisely what you mean by "standard input", there may be a >not-horribly-nonportable way. A while back, in comp.sources.misc, Dan Smith posted a routine named "grabchars" that does this for Sun's and BSD systems. Email me if you want a copy. Here is a brief description: } v05i073: grabchars 1.3, get/filter keystrokes directly from user (BSD) } "grabchars" gets one or more keystrokes from the user, without } requiring them to hit return. It was written to make shell scripts } (doesn't matter what type) more interactive. ... } Enjoy, and send me your comments/suggestions. 2.0 will provide } SYS V support. -- Ron Nash San Diego State University Internet: nash@ucselx.sdsu.edu Gin-N-Tonic 5 year old 1/2 Arab endurance prospect Luv on Fire 8 year old Arab, trusty steed and friend