Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0
When a variable name is supplied to the read builtin, leading and
trailing white spaces are stripped from the input:
read line <<< " x "; echo "[$line]"
outputs
[x]
as expected.
If no names are supplied then leading and trailing white spaces are
preserved:
read <<< " x "; echo "[$REPLY]"
outputs
[ x ]
Is this intended behaviour of read builtin? If so where is it
documented? The Bash Reference Manual says only "If no names
are supplied, the line read is assigned to the variable REPLY."
There is no mention of preserving leading and trailing white
spaces.