[Top][All Lists]

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

Re: Strange behaviour of read builtin

From: M. Nejat AYDIN
Subject: Re: Strange behaviour of read builtin
Date: Thu, 2 Jul 2020 03:08:19 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 7/1/20 2:25 PM, Greg Wooledge wrote:
How else would you interpret "the line read is assigned to the variable
REPLY"?  Read the line, assign it to the variable.  Do not pass Go,
do not perform IFS whitespace trimming.

Fair enough. The paragraph in which that sentence occurs contains also such sentences that read: "One line is read from the standard
input,[...] split into words as described above in Word Splitting[...]"
and "The characters in the value of the IFS variable are used to split
the line into words [...] described above in Word Splitting". So it is
not obvious, at least to me, from that paragraph whether the word
splitting is applicable to the line in case no names are supplied to the
read builtin.

Also, that sentence might be interpreted such that the terminating
new-line character (or the character specified by the -d option)
is not to be removed when assigning to REPLY, since that character is
part of the line.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]