bug-bash
[Top][All Lists]
Advanced

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

Re: Builtin 'read' data not saved


From: P Fudd
Subject: Re: Builtin 'read' data not saved
Date: Thu, 2 Jan 2014 11:35:11 -0800
User-agent: SquirrelMail/1.4.20-2.fc11

Here's some more oddities:

=====failing.sh:
#!/bin/bash
R="1|2"
IFS='|' read -r A B <<< $R
echo A=$A, B=$B
====
Expected: "A=1, B=2"
Actual: "A=1 2, B="


====fail2.sh:
#!/bin/bash
R="1|2"
while IFS='|' read -r A B; do
echo 1:A=$A, B=$B
done <<< $R
echo 2:A=$A, B=$B
====
Expected:
  1:A=1, B=2
  2:A=1, B=2
Actual:
  1:A=1, B=2
  2:A=, B=


GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)
bash-4.2-2ubuntu2.1.deb

Cheers!
--
address@hidden
Thanks!



reply via email to

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