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

[ale] Perplexed by bash



Can anyone tell me why the while loop in the below code affects the
setting of the variable RC?  I'm at a loss.  Remove the while loop, and it
works just fine...
--
#!/bin/bash
function getRC
{
  RC="123"
}

getRC \
| while read line
do
  echo "456"
done

echo "RC: $RC"