On Thu, Jul 18, 2024, at 8:57 AM, Greg Wooledge wrote:
> $a is equivalent to ${a[0]}.
This is documented, by the way. It is not a bug.
"Referencing an array variable without a subscript is equivalent to referencing
with a subscript of 0."
https://www.gnu.org/software/bash/manual/html_node/Arra
On Thu, Jul 18, 2024 at 00:00:17 +, Charles Dong via Bug reports for the
GNU Bourne Again SHell wrote:
> - Declare an array: `a=(aa bb cc dd)`
> - Print this array: `echo $a` or `printf $a`
$a is equivalent to ${a[0]}. That's not how you print an entire array.
The easiest way to print an ar