reading stdin for tcsh script

Bill Farmer farmer at media-lab.MEDIA.MIT.EDU
Thu Jan 17 12:57:12 AEST 1991


I am working on an ultrix platform, with tcsh.  I want
to input from stdin into shell scripts.  In bourne
this function is 'read'.  In c shell, and therefore
presumably tc shell, this is effected with the symbol
$<, e.g. set superstar = $<.  This set command will 
work fine from the shell itself, so that subsequently when
i enter echo $superstar, the string I typed and entered immediatley
after the set command is correctly echoed.  However when i 
include this command in a script, errors occur.  A simplified 
example of my desired use is as follows:

	echo Enter NAME :
	set title = $<
	echo  Name : $title

if this is run like this, as a 3 line script i get the error 
message 'line 3 newline not expected'.  if i variously apply
quotes and double quotes in line 2, the program will execute 
but will not pause to read in the data from stdin, but will 
assign title the null string.
	anyone got a handle on what's happening here?  if 
a newline is not expected, what is expected? not ; and not \,
attempts using these result in messages saying that they're
not expected, either. 

				bill farmer
				farmer at media-lab.media.mit.edu



More information about the Comp.unix.ultrix mailing list