Re: Probably very stupid script/bash question
- From: Brian <Brian_dorling@xxxxxxxxxxx>
- Date: Wed, 05 Mar 2008 14:13:33 +0100
Mark Clarkson wrote:
On Tue, 04 Mar 2008 18:46:05 +0100Mark,
Brian <Brian_dorling@xxxxxxxxxxx> wrote:
I could not get this to work, the shell complains:
./dirvish-mail.sh: 98: Syntax error: redirection unexpected
Interesting to note that this does not work under busybox. I think
this is rather an esoteric but often useful bash feature. (It also
needs /proc so is not available in some special cases.)
The other solution from Alex:
>> echo "$teststring" | ( read A B C D E F; )
Of course, both solutions work perfectly under bash.
This should not have worked under bash either since it is still running
in a sub-shell, so the variables are lost when read finishes.
of course you are correct. I had written the following test script:
=================================================================
#!/bin/bash
teststring="one two three four five six"
{ read A B C D E F; } < <( echo "$teststring" )
echo "Data received = $E Bytes"
echo "$teststring" | ( read A B C D E F; )
echo "Data received = $E Bytes"
=================================================================
$E was still set from the first read call. Duuh.
So can you explain exactly what the first < <( echo "$teststring" )
does exactly please?
Cheers Brian
--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
- Follow-Ups:
- Re: Probably very stupid script/bash question
- From: Michelle Konzack
- Re: Probably very stupid script/bash question
- From: Bob McGowan
- Re: Probably very stupid script/bash question
- Prev by Date: Re: LANG=C not English?
- Next by Date: Missing ncurses.h when compiling Kermit on Etch
- Previous by thread: Re: Probably very stupid script/bash question
- Next by thread: Re: Probably very stupid script/bash question
- Index(es):