Prompting for yes/no in csh

Brandon S. Allbery KB8JRR allbery at NCoast.ORG
Fri Jan 11 15:10:48 AEST 1991


As quoted from <1660 at inews.intel.com> by bhoughto at hopi.intel.com (Blair P. Houghton):
+---------------
| In article <3821 at ns-mx.uiowa.edu> dkeber at 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=$<
| 
| RTFM for csh(1) and echo(1).  You could have learned all of
+---------------

The ancient csh's supplied as value-added by most System V vendors do not have
$< --- the manual csh(1) won't help here.  But there is usually a "line"
command that can be used similarly:

	echo "continue? \c"
	set foo="`line`"

++Brandon
-- 
Me: Brandon S. Allbery			    VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery at NCoast.ORG		    Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR			    AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery    Delphi: ALLBERY



More information about the Comp.unix.shell mailing list