[ale] Perplexed by bash

John Wells jb at sourceillustrated.com
Tue May 3 17:18:02 EDT 2005


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"



More information about the Ale mailing list