Re: best way to test for empty dir?

2009-12-12 Thread Matias A. Fonzo
On Sat, 12 Dec 2009 10:51:31 +0100 Andreas Schwab wrote: > "Matias A. Fonzo" writes: > > > A solution to check the broken symlink is: > > > > [ -e "foo" -o -L "foo" -a ! -e "foo" ] > > In which way is the last check not redundant? > In the sense that you have -e to check existing files and n

Re: add a way to declare global variables

2009-12-12 Thread Bernd Eggink
Am 12.12.2009 21:41, schrieb Chet Ramey: On 12/12/09 5:28 AM, Bernd Eggink wrote: Am 10.12.2009 10:40, schrieb konsolebox: I hope the development team will also consider adding a way in bash to declare global variables inside a function perhaps either with an option in typeset or declare like

Re: add a way to declare global variables

2009-12-12 Thread Chet Ramey
On 12/12/09 5:28 AM, Bernd Eggink wrote: > Am 10.12.2009 10:40, schrieb konsolebox: > >> I hope the development team will also consider adding a way in bash to >> declare global variables inside a function perhaps either with an >> option in typeset or declare like -g (same as zsh) and/or a builti

Re: add a way to declare global variables

2009-12-12 Thread Stephane CHAZELAS
2009-12-12, 12:37(-05), Chet Ramey: > On 12/12/09 5:24 AM, Bernd Eggink wrote: > >> It's the other way round. Regarding typeset and declare, the man page >> says: " When used in a function, makes each name local, as with the >> local command. " So within a function, typeset, declare, and local are

Re: add a way to declare global variables

2009-12-12 Thread Chet Ramey
On 12/12/09 5:24 AM, Bernd Eggink wrote: > It's the other way round. Regarding typeset and declare, the man page > says: " When used in a function, makes each name local, as with the > local command. " So within a function, typeset, declare, and local are > synonyms. Using 'local' outside a funct

Re: add a way to declare global variables

2009-12-12 Thread Bernd Eggink
Am 12.12.2009 15:25, schrieb DennisW: On Dec 12, 4:24 am, Bernd Eggink wrote: Am 12.12.2009 02:11, schrieb Matthew Woehlke: konsolebox wrote: I hope the development team will also consider adding a way in bash to declare global variables inside a function perhaps either with an option in typ

Re: add a way to declare global variables

2009-12-12 Thread Bernd Eggink
Am 12.12.2009 15:25, schrieb DennisW: On Dec 12, 4:24 am, Bernd Eggink wrote: Am 12.12.2009 02:11, schrieb Matthew Woehlke: konsolebox wrote: I hope the development team will also consider adding a way in bash to declare global variables inside a function perhaps either with an option in typ

Re: output redirection with process substitution asynchronous?

2009-12-12 Thread pjodrr
Hello again, I have to reply to my own post to correct it: On Dec 8, 2:00 pm, pjodrr wrote: > coproc prefix_timestamp > seq 10>&${COPROC[1]} > eval "exec ${COPROC[1]}>&-" > cat <&${COPROC[0]} > wait $COPROC_PID replace this with: { coproc prefix_timestamp >&3 ; } 3>&1 seq 10>&${COPROC[1]} eval

Re: add a way to declare global variables

2009-12-12 Thread DennisW
On Dec 12, 4:24 am, Bernd Eggink wrote: > Am 12.12.2009 02:11, schrieb Matthew Woehlke: > > > konsolebox wrote: > >> I hope the development team will also consider adding a way in bash to > >> declare global variables inside a function perhaps either with an > >> option in typeset or declare like

Re: add a way to declare global variables

2009-12-12 Thread Bernd Eggink
Am 12.12.2009 11:24, schrieb Bernd Eggink: Am 12.12.2009 02:11, schrieb Matthew Woehlke: konsolebox wrote: I hope the development team will also consider adding a way in bash to declare global variables inside a function perhaps either with an option in typeset or declare like -g (same as zsh)

Re: kill builtin incorrectly works with -s -n and -PGID options

2009-12-12 Thread Stephane CHAZELAS
2009-12-11, 06:17(-07), Eric Blake: > > According to Roman Rakus on 12/11/2009 6:08 AM: >> kill builtin incorrectly thinks that -PGID is signal name even if the >> signal name is set by -s or -n option. >> >> [rra...@dhcp-lab-170 ~]$ kill -s TERM -5032 >> bash: kill: 5032: invalid signal specifica

Re: add a way to declare global variables

2009-12-12 Thread Stephane CHAZELAS
2009-12-12, 11:28(+01), Bernd Eggink: > Am 10.12.2009 10:40, schrieb konsolebox: > >> I hope the development team will also consider adding a way in bash to >> declare global variables inside a function perhaps either with an >> option in typeset or declare like -g (same as zsh) and/or a builtin >>

Re: best way to test for empty dir?

2009-12-12 Thread Stephane CHAZELAS
2009-12-12, 10:21(+00), Stephane CHAZELAS: [...] >> exists() >> { >> [ -e "$1" -o -L "$1" ] >> } > > $ exists = > bash: [: too many arguments > > [ -e "$1" ] -o [ -L "$1" ] [...] Sorry, I meant [ -e "$1" ] || [ -L "$1" ] -- Stéphane

Re: best way to test for empty dir?

2009-12-12 Thread Stephane CHAZELAS
2009-12-11, 16:16(+00), Marc Herbert: > Sven Mascheck a écrit : >> Chris F.A. Johnson wrote: >> >>> This has been discussed more than once in c.u.s; check the >>> archives. >> >> and that's why we better discuss it here now? > > I think Chris' message was more like: "let's not discuss it at all a

Re: add a way to declare global variables

2009-12-12 Thread Chris F.A. Johnson
On Sat, 12 Dec 2009, Bernd Eggink wrote: > Am 12.12.2009 02:11, schrieb Matthew Woehlke: > > konsolebox wrote: > > > I hope the development team will also consider adding a way in bash to > > > declare global variables inside a function perhaps either with an > > > option in typeset or declare lik

Re: add a way to declare global variables

2009-12-12 Thread Bernd Eggink
Am 10.12.2009 10:40, schrieb konsolebox: I hope the development team will also consider adding a way in bash to declare global variables inside a function perhaps either with an option in typeset or declare like -g (same as zsh) and/or a builtin function like global as similar to local. I seco

Re: add a way to declare global variables

2009-12-12 Thread Bernd Eggink
Am 12.12.2009 02:11, schrieb Matthew Woehlke: konsolebox wrote: I hope the development team will also consider adding a way in bash to declare global variables inside a function perhaps either with an option in typeset or declare like -g (same as zsh) and/or a builtin function like global as sim

Re: best way to test for empty dir?

2009-12-12 Thread Andreas Schwab
"Matias A. Fonzo" writes: > A solution to check the broken symlink is: > > [ -e "foo" -o -L "foo" -a ! -e "foo" ] In which way is the last check not redundant? Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now f