Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!olivea!orc!inews!hopi!bhoughto From: bhoughto@hopi.intel.com (Blair P. Houghton) Newsgroups: comp.unix.shell Subject: Re: Prompting for yes/no in csh Message-ID: <1660@inews.intel.com> Date: 8 Jan 91 16:20:25 GMT References: <3821@ns-mx.uiowa.edu> Sender: news@inews.intel.com Distribution: usa Organization: Intel Corp, Chandler, AZ Lines: 20 In article <3821@ns-mx.uiowa.edu> dkeber@umaxc.weeg.uiowa.edu (Dave Keber) writes: >What is the easiest way to prompt for a yes/no (or any string/number, etc.) >from a csh shell script? echo -n "continue? " set foo=$< Salient points: The -n leaves the cursor on the same line as the prompt; the quotes allow a space after the prompt; $< reads the script's standard input up to a newline; and, foo will contain everything typed, including whitespace, but not the newline. RTFM for csh(1) and echo(1). You could have learned all of this there. It's the advice of everyone who's ever answered (or asked) a question on the net that you exhaust your resources before asking such questions. --Blair "Resource your exhaust?"