[Next] [Previous] [Up] [Top] [Contents]

9.7 Interactive Input

9.7.2 Csh

Csh uses the $< symbol to read a line from stdin, e.g.:

set param = $<

The spaces around the equal sign are important. The following script illustrates how to use this.

#!/bin/csh -f

echo -n "Input a phrase " # This built-in echo requires -n to prevent <newline>

set param = $<

echo param=$param

Again, it prompts for input and echoes the results:

% ./read.csh

Input a phrase hello frank # I type in hello frank <return>

param=hello frank

Introduction to Unix - 14 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]