Re: best way to test for empty dir?

2009-12-15 Thread Antonio Macchi
[ -e "foo" -o -L "foo" -a ! -e "foo" ] it has no sense doing twice the "-e" test $ ln -s nonexistent foo $ [ -e "foo" -o -L "foo" -a ! -e "foo" ] && echo ok || echo ko ok $ [ -e "foo" -o -L "foo" ] && echo ok || echo ko ok as you can see, the first "-e" check imply the second one (aka, if

Re: best way to test for empty dir?

2009-12-15 Thread Matias A. Fonzo
On Tue, 15 Dec 2009 15:23:33 +0100 Andreas Schwab wrote: > "Matias A. Fonzo" writes: > > > On Tue, 15 Dec 2009 10:37:36 +0100 > > Andreas Schwab wrote: > > > >> "Matias A. Fonzo" writes: > >> > >> > On Mon, 14 Dec 2009 12:21:12 + > >> > Marc Herbert wrote: > >> > > >> >> Matias A. Fonzo

Re: best way to test for empty dir?

2009-12-15 Thread Andreas Schwab
"Matias A. Fonzo" writes: > On Tue, 15 Dec 2009 10:37:36 +0100 > Andreas Schwab wrote: > >> "Matias A. Fonzo" writes: >> >> > On Mon, 14 Dec 2009 12:21:12 + >> > Marc Herbert wrote: >> > >> >> Matias A. Fonzo a écrit : >> >> > On Fri, 11 Dec 2009 16:16:13 + >> >> > Marc Herbert wrote

Re: best way to test for empty dir?

2009-12-15 Thread Matias A. Fonzo
On Tue, 15 Dec 2009 10:37:36 +0100 Andreas Schwab wrote: > "Matias A. Fonzo" writes: > > > On Mon, 14 Dec 2009 12:21:12 + > > Marc Herbert wrote: > > > >> Matias A. Fonzo a écrit : > >> > On Fri, 11 Dec 2009 16:16:13 + > >> > Marc Herbert wrote: > >> > >> >> In case anyone is interes

Re: best way to test for empty dir?

2009-12-15 Thread Andreas Schwab
"Matias A. Fonzo" writes: > On Mon, 14 Dec 2009 12:21:12 + > Marc Herbert wrote: > >> Matias A. Fonzo a écrit : >> > On Fri, 11 Dec 2009 16:16:13 + >> > Marc Herbert wrote: >> >> >> In case anyone is interested my winner (so far) is: >> >> >> >> exists() >> >> { >> >> [ -e "$1" -o

PIPESTATUS array is incorrect after a trap

2009-12-15 Thread Florian Bruhin
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='bash