Re: -e does not work with subscript

2008-01-29 Thread Linda Walsh
Stepan Koltsov wrote: BTW, my use case for "(false)" is: === set -e ( cd some-dir && make ) ( cd other-dir && ./build.sh ) ( cd third-dir && ant ) === Most readers (and writers) expect script to fail if "make" failed. So I think that outer bash should exit with error on "(false)" :-)

Re: -e does not work with subscript

2008-01-29 Thread Stepan Koltsov
On 1/30/08, Bob Proulx <[EMAIL PROTECTED]> wrote: > Stepan Koltsov wrote: > > set -e > > ( cd some-dir && ./build.sh ) > > ... > > Most readers (and writers) expect script to fail if "./build.sh" failed. So > > I think that outer bash should exit with error on "(false)" :-) > > Of course, script ca

Re: -e does not work with subscript

2008-01-29 Thread Bob Proulx
Stepan Koltsov wrote: > set -e > ( cd some-dir && make ) > ... > Most readers (and writers) expect script to fail if "make" failed. So > I think that outer bash should exit with error on "(false)" :-) > Of course, script can be rewritten as > ( cd some-dir && make ) || false Of course the script c

Re: -e does not work with subscript

2008-01-29 Thread Stepan Koltsov
BTW, my use case for "(false)" is: === set -e ( cd some-dir && make ) ( cd other-dir && ./build.sh ) ( cd third-dir && ant ) === Most readers (and writers) expect script to fail if "make" failed. So I think that outer bash should exit with error on "(false)" :-) Of course, script can be rewritte

Re: -e does not work with subscript

2008-01-29 Thread Pierre Gaston
On Jan 29, 2008 8:09 PM, Stepan Koltsov <[EMAIL PROTECTED]> wrote: > What is "simple command"? > > Is > > === > ( false ) || false > === > > simple? Seems like it is not, however > > === > set -e > > ( false ) || false > > echo "end" > === > > Prints nothing and exits with error. Indeed according

Re: -e does not work with subscript

2008-01-29 Thread Stepan Koltsov
What is "simple command"? Is === ( false ) || false === simple? Seems like it is not, however === set -e ( false ) || false echo "end" === Prints nothing and exits with error. S. On 1/29/08, Pierre Gaston <[EMAIL PROTECTED]> wrote: > On Jan 29, 2008 10:04 AM, Stepan Koltsov <[EMAIL PROTECT

Re: -e does not work with subscript

2008-01-29 Thread Pierre Gaston
On Jan 29, 2008 10:04 AM, Stepan Koltsov <[EMAIL PROTECTED]> wrote: > > Bash must exit the shell too. Because > > $ bash -ce '(false); echo $?' > 1 > > S. > (false) is a compound command, the bash exits with set -e only if a simple command exits with false

Re: -e does not work with subscript

2008-01-29 Thread 龙海涛
> $ bash -ce '(false;echo foo);echo bar' > bar could i ask what the command line option '-e' mean? i did not find any explanation in bash's manual. PS: [EMAIL PROTECTED] ~]# bash --version GNU bash, version 3.1.17(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2005 Free Software Foundation, I

Re: -e does not work with subscript

2008-01-29 Thread Stepan Koltsov
On 1/29/08, Pierre Gaston <[EMAIL PROTECTED]> wrote: > On Jan 28, 2008 11:36 PM, <[EMAIL PROTECTED]> wrote: > > Configuration Information [Automatically generated, do not change]: > > Machine: i486 > > OS: linux-gnu > > Compiler: gcc > > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'

Re: -e does not work with subscript

2008-01-29 Thread 龙海涛
> It has the same effect as set -e, you can pass the options of set to > bash directly bash -x etc... > got it. thanks > The manual says: > "In addition to the single-character shell options documented in the > description of the set builtin command, bash interprets the following > options when

Re: -e does not work with subscript

2008-01-28 Thread Pierre Gaston
On Jan 29, 2008 9:32 AM, 龙海涛 <[EMAIL PROTECTED]> wrote: > > > $ bash -ce '(false;echo foo);echo bar' > > bar > could i ask what the command line option '-e' mean? > i did not find any explanation in bash's manual. It has the same effect as set -e, you can pass the options of set to bash directly b

Re: -e does not work with subscript

2008-01-28 Thread Pierre Gaston
On Jan 28, 2008 11:36 PM, <[EMAIL PROTECTED]> wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i486 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'

-e does not work with subscript

2008-01-28 Thread yozh
Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba