Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-26 Thread Buzz
[No need to Cc me.] Op Wed, 25 Jan 2006 20:28:32 + schreef Eric Blake in 012520062028.10525.43D7DF6F0008E6E6291D22007507840A050E040D0C079D0Aatcomcast.net: [Adding attrib to self:] : Buzz: : I (now) understand what's happening. I think it's undesirable, though. : : That's a relative

Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bas van Gompel on 1/24/2006 10:11 PM: Hi, Try the following script: === begin testexec.sh === #!/bin/ksh exec 50 /bin/ksh EOSH echo First exec: Done. exec 05 echo Second exec: Done. exit 0 EOSH end testexec.sh

Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc +redirect == trouble!

2006-01-25 Thread Igor Peshansky
On Wed, 25 Jan 2006, Bas van Gompel wrote: Hi, Try the following script: === begin testexec.sh === #!/bin/ksh exec 50 /bin/ksh EOSH echo First exec: Done. exec 05 echo Second exec: Done. exit 0 EOSH end testexec.sh You might want to quote 'EOSH', but that's not the cause

Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-25 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Eric Blake on 1/25/2006 7:41 AM: === begin testexec.sh === #!/bin/ksh exec 50 /bin/ksh EOSH echo First exec: Done. exec 05 echo Second exec: Done. exit 0 EOSH end testexec.sh First line: This could be rewritten exec

Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc +redirect == trouble!

2006-01-25 Thread Eric Blake
You might want to quote 'EOSH', but that's not the cause of your problem. Here's a funny thing: #!/bin/bash exec 50 /bin/bash 'EOSH' echo First exec: Done. cat exec 05 echo Second exec: Done. exit 0 EOSH works for me. Don't ask me why, though. Perhaps Eric will chime in. Define

Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-25 Thread Igor Peshansky
On Wed, 25 Jan 2006, Eric Blake wrote: You might want to quote 'EOSH', but that's not the cause of your problem. Here's a funny thing: #!/bin/bash exec 50 /bin/bash 'EOSH' echo First exec: Done. cat exec 05 echo Second exec: Done. exit 0 EOSH works for me. Don't ask me

Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-25 Thread Buzz
Op Wed, 25 Jan 2006 07:41:45 -0700 schreef Eric Blake in 43D78E29.4060504atbyu.net: : : According to Bas van Gompel on 1/24/2006 10:11 PM: [script] : First line: This could be rewritten exec /bin/ksh 50 EOSH. Either : way, you are replacing the current shell with an invocation of /bin/ksh, :

Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-25 Thread Eric Blake
I (now) understand what's happening. I think it's undesirable, though. That's a relative viewpoint. Personally, I like the fact that the rules are consistent (process instructions one line at a time; and apply pipelines first, then apply all redirections, including here-docs, in left-to-right

Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble!

2006-01-24 Thread Bas van Gompel
Hi, Try the following script: === begin testexec.sh === #!/bin/ksh exec 50 /bin/ksh EOSH echo First exec: Done. exec 05 echo Second exec: Done. exit 0 EOSH end testexec.sh (Replace ksh with bash or zsh at will, above.) For me, this prints ``First exec: Done.'', then leaves me to