Re: Probably very stupid script/bash question

2008-03-10 Thread Michelle Konzack
Am 2008-03-05 14:13:33, schrieb Brian: teststring=one two three four five six { read A B C D E F; } ( echo $teststring ) echo Data received = $E Bytes END OF REPLIED MESSAGE This look a little bit weird. Why not use:

Re: Probably very stupid script/bash question

2008-03-10 Thread Michelle Konzack
Am 2008-03-05 13:10:37, schrieb Bob McGowan: Mark Clarkson wrote: On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please? man bash

Re: Probably very stupid script/bash question

2008-03-10 Thread Bob McGowan
Michelle Konzack wrote: Am 2008-03-05 14:13:33, schrieb Brian: teststring=one two three four five six { read A B C D E F; } ( echo $teststring ) echo Data received = $E Bytes END OF REPLIED MESSAGE This look a little bit weird. Why not use:

Re: Probably very stupid script/bash question

2008-03-10 Thread Bob McGowan
Michelle Konzack wrote: Am 2008-03-05 13:10:37, schrieb Bob McGowan: Mark Clarkson wrote: On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please? man bash

Re: Probably very stupid script/bash question

2008-03-05 Thread Brian
Mark Clarkson wrote: On Tue, 04 Mar 2008 18:46:05 +0100 Brian [EMAIL PROTECTED] 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

Re: Probably very stupid script/bash question

2008-03-05 Thread Bob McGowan
Brian wrote: Mark Clarkson wrote: On Tue, 04 Mar 2008 18:46:05 +0100 Brian [EMAIL PROTECTED] 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

Re: Probably very stupid script/bash question

2008-03-05 Thread Mark Clarkson
On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please? In any case, I'd be interested in knowing where you found this construct. The bash man page seems to be one of

Re: Probably very stupid script/bash question

2008-03-05 Thread Bob McGowan
Mark Clarkson wrote: On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please? In any case, I'd be interested in knowing where you found this construct. The bash man page

Re: Probably very stupid script/bash question

2008-03-05 Thread Mark Clarkson
On Wed, 05 Mar 2008 13:10:37 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Mark Clarkson wrote: On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please? In any case,

Re: Probably very stupid script/bash question

2008-03-05 Thread Bob McGowan
Mark Clarkson wrote: On Wed, 05 Mar 2008 13:10:37 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Mark Clarkson wrote: On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please?

Re: Probably very stupid script/bash question

2008-03-05 Thread William Pursell
Mark Clarkson wrote: On Wed, 05 Mar 2008 13:10:37 -0800 Bob McGowan [EMAIL PROTECTED] wrote: If I do the process substitution using a stand alone programs, it works as described: $ wc (echo this is a test) 1 4 15 /dev/fd/63 I couldn't find the correct place to

Re: Probably very stupid script/bash question

2008-03-05 Thread Rich Healey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 William Pursell wrote: I couldn't find the correct place to interject this question in the thread, so I fairly randomly selected this location... As far as I can tell, the following 4 commands should all behave the same, but the last one hangs.

Re: Probably very stupid script/bash question

2008-03-05 Thread Mike Bird
On Wed March 5 2008 15:36:50 William Pursell wrote: As far as I can tell, the following 4 commands should all behave the same, but the last one hangs. Can anyone see why? $ cat (echo foo) foo $ bash -c 'cat (echo foo)' foo $ echo foo | bash -c 'cat' foo $ bash -c 'cat' (echo foo) The

Re: Probably very stupid script/bash question

2008-03-04 Thread Brian
Georg Neis wrote: Brian wrote: 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 I assume it has something to do with the read command being executed in a subshell. Yes. So how can I extract the parts I

Re: Probably very stupid script/bash question

2008-03-04 Thread Brian
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 Robomod, I could not get this to work,

Re: Probably very stupid script/bash question

2008-03-04 Thread Mark Clarkson
On Tue, 04 Mar 2008 18:46:05 +0100 Brian [EMAIL PROTECTED] 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

Probably very stupid script/bash question

2008-03-03 Thread Brian
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 I assume it has something to

Re: Probably very stupid script/bash question

2008-03-03 Thread Alex Samad
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

Re: Probably very stupid script/bash question

2008-03-03 Thread Mark Clarkson
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 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of

Re: Probably very stupid script/bash question

2008-03-03 Thread Georg Neis
Brian wrote: 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 I assume it has something to do with the read command being executed in a subshell. Yes. So how can I extract the parts I want into