Re: Builtin 'read' data not saved
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
Builtin 'read' data not saved
Hello all, I'm at my wit's end. This script is not working: = #!/bin/bash B=none echo "2" | while read -r A; do B="$A" echo 1.B=$B done echo 2.B=$B == The output, from GNU bash, version 4.2.25(1)-release (x86_64-p