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

Re: read and REPLY



Dale Scheetz writes:

>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?

	echo $REPLY

or

	echo ${REPLY}

or

	echo "$REPLY"

etc

You might be interested to know that the bit about REPLY doesn't apply
under some versions of sh - you have to specify at least one variable
name.  The bash man page is like all man pages perfectly adequate for
reference but no fun at all to learn from..

-- 
Richard Kettlewell
richard@elmail.co.uk                    http://www.elmail.co.uk/staff/richard/


Reply to: