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-pc-linux-gnu), bash-4.2-2ubuntu2.1.deb, is this:
1.B=2
2.B=none
I'm baffled; it's like the while loop is in a parallel universe. I tried
'export B=none' in line 2, with no effect.
Help?
--
fink@ch.pkts.ca