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

Re: Probably very stupid script/bash question

Mark Clarkson wrote:
On Mon, 2008-03-03 at 19:48 +0100, Brian wrote:
echo "$teststring" | { read A B C D E F; }
echo "Data received = $E Bytes"  <--- $E is empty

{ read A B C D E F; } < <( echo "$teststring" )
echo "Data received = $E Bytes"  <--- $E is empty


I could not get this to work, the shell complains:

./dirvish-mail.sh: 98: Syntax error: redirection unexpected

The other solution from Alex:

>> echo "$teststring" | ( read A B C D E F; )

did not work either.

Then I got to wondering about why a few methods that I had tried before posting did not work either, although they were documented many times. I was doing the testing on an NSLU2 which uses Busybox, and its default shell "sh" and not bash (I also have an NSLU2 with Debian on it, there the shell is bash). So I assume this has something to do with busybox's shell.

Of course, both solutions work perfectly under bash.

Cheers Brian

Reply to: