On Mon, Mar 03, 2008 at 07:48:49PM +0100, Brian wrote: > Hi, > > I tried using bash to split a string. This works OK: > > echo "$teststring" | { read A B C D E F; echo "Data received = $E Bytes"; } > > The following does not (the value is empty): > > echo "$teststring" | { read A B C D E F; } > echo "Data received = $E Bytes" <--- $E is empty maybe
echo "$teststring" | ( read A B C D E F; ) why do you need the {} or () > > I assume it has something to do with the read command being executed in > a subshell. > > So how can I extract the parts I want into variables to use them later > on in the script? > > Thanks in advance > > Cheers Brian > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a > subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > > -- "I hear the voices, and I read the front page, and I know the speculation, but Im the decider and I decide what is best. And whats best is for Don Rumsfeld to remain as secretary of defense." - George W. Bush 04/18/2006 Washington, DC
signature.asc
Description: Digital signature