Re: 100% cpu with: while true ;do read /dev/null ;done

2009-10-23 Thread Marc Herbert
Jo King a écrit : thanks for reply. agree it's not a bug with bash. i am inclinded to agree with the comments but bash is popular and attracts a lot of newbies into scripting - a bit of smart 'correction' of their wrong ways would at least keep the cpu available for other processes (even a

Re: 100% cpu with: while true ;do read /dev/null ;done

2009-10-22 Thread Pierre Gaston
On Thu, Oct 22, 2009 at 12:15 AM, Jo King joki...@yahoo.co.uk wrote: Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu'

Re: 100% cpu with: while true ;do read /dev/null ;done

2009-10-22 Thread Jo King
pierre.gas...@gmail.com Subject: Re: 100% cpu with: while true ;do read /dev/null ;done To: Jo King joki...@yahoo.co.uk Cc: bug-bash@gnu.org Date: Thursday, 22 October, 2009, 7:08 On Thu, Oct 22, 2009 at 12:15 AM, Jo King joki...@yahoo.co.uk wrote: Configuration Information

100% cpu with: while true ;do read /dev/null ;done

2009-10-21 Thread Jo King
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale'

Re: 100% cpu with: while true ;do read /dev/null ;done

2009-10-21 Thread Jan Schampera
Jo King schrieb: Fix: [ bash/the read code could detect there's no stdin and sleep for 1-2 seconds] If you consider this as a bug, the bug is not in Bash (but in the application). In short you request that read should wait a second, once it got a end-of-file signalled, I don't think

Re: 100% cpu with: while true ;do read /dev/null ;done

2009-10-21 Thread Mike Frysinger
On Thursday 22 October 2009 01:10:33 Jan Schampera wrote: Jo King schrieb: Fix: [ bash/the read code could detect there's no stdin and sleep for 1-2 seconds] If you consider this as a bug, the bug is not in Bash (but in the application). In short you request that read should