[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: read and REPLY



On Wed, 24 Apr 1996, Dale Scheetz wrote:

> I am very new to script writing so pardon my ignorance. I have been
> working from the bash man page. It indicates that read (with no
> parameters) puts the line read into the predefined variable REPLY. My
> problem is that I don't seem to be able to *use* the variable. With a line
> like: echo "$(REPLY)" or echo $(REPLY) I get the error : REPLY command not
> found. If I try: echo REPLY the output is just REPLY.
> How do I get the contents of reply?

I'm not much of a shell programmer myself, but I think $(REPLY) will try 
to execute the file REPLY in a subshell.  However, you can access the 
value of the variable REPLY with $REPLY (no parens).  'echo REPLY' will just 
display "REPLY", but 'echo $REPLY' will echo the value of the variable 
$REPLY.

Someone correct me if I'm wrong.

Gerry


Reply to: