help with c-shell input
John J Boland
jjb at world.std.com
Mon Sep 27 11:39:00 EDT 2004
In an earlier episode, Bob Leigh said:
>John J Boland <jjb at world.std.com> wrote:
>> right now, i'm stuck trying to read from the keyboard!
>> using, bourne or korn, i'd just use 'read variable'. however, when i
>> try the same line in c-shell, i get "undefined variable"!
>> any ideas how to get the user to enter their selection?
>
>Try this:
>
> set variable=$<
>
>Here's an extract from the csh(1) manpage:
>
> $< Substitutes a line from the standard input, with no further
>interpretation. It can be used to read from the keyboard
> in a shell script.
>
Thanks Bob! It workd like a charm.
More information about the Discuss
mailing list