Re: bug with built-in commands in bash when redirecting output

2007-01-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Norton Allen on 1/28/2007 1:08 PM: > I'm wondering if the problem I am seeing is from the same source. I find > that 'apachectl stop' no longer works since a recent cygwin update. I > can see that the PIDFILE is being written with a \r\n l

Re: bug with built-in commands in bash when redirecting output

2007-01-28 Thread Norton Allen
The following one liner illustrates a bug in sh: $ /bin/bash -c '/bin/bash -cx '\''x=`echo hello`'\''' > @x ++ echo hello + x=$'hello\r' $ I'm wondering if the problem I am seeing is from the same source. I find that 'apachectl stop' no longer works since a recent cygwin update. I can see t

Re: bug with built-in commands in bash when redirecting output

2007-01-24 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Sjoerd Mullender on 1/24/2007 2:00 AM: > On 2007-01-27 21:33:08, Eric Blake wrote: >> Meanwhile, have you considered using the cygwin-specific igncr shellopt? > > No, I haven't, and it's not really an option in real life. I found the > p

Re: bug with built-in commands in bash when redirecting output

2007-01-24 Thread Sjoerd Mullender
On 2007-01-27 21:33:08, Eric Blake wrote: > Meanwhile, have you considered using the cygwin-specific igncr shellopt? No, I haven't, and it's not really an option in real life. I found the problem with a libtool-generated script and I'd have to change that script in order to pass the option. I'm

Re: bug with built-in commands in bash when redirecting output

2007-01-23 Thread Eric Blake
Eric Blake byu.net> writes: > > So, I retract that it is a cygwin bug, and instead claim it is an upstream bash > bug. It is solved by doing freopen(NULL,"w",stdout) after replacing the fd, > since that is the mechanism for telling stdio that it should please choose the > correct text or b

Re: bug with built-in commands in bash when redirecting output

2007-01-23 Thread Eric Blake
Eric Blake byu.net> writes: > > I am suspecting a potential cygwin bug in fork(). Using the builtin echo, the > sequence is that bash creates the pipe, then forks, the forked child sees that > stdout is text mode, then rearranges fd's around so that the pipe is now > attached to stdout, al

Re: bug with built-in commands in bash when redirecting output

2007-01-23 Thread Eric Blake
Sjoerd Mullender acm.org> writes: > > The following one liner illustrates a bug in sh: > $ /bin/bash -c '/bin/bash -cx '\''x=`echo hello`'\''' > x > ++ echo hello > + x=$'hello\r' > $ Odd. But reproducible - thanks for the test case. Even though the cygwin documentation states that the pip

bug with built-in commands in bash when redirecting output

2007-01-23 Thread Sjoerd Mullender
The following one liner illustrates a bug in sh: $ /bin/bash -c '/bin/bash -cx '\''x=`echo hello`'\''' > @x ++ echo hello + x=$'hello\r' $ The problem is as follows. When a built-in shell command (such as pwd or echo) is executed within back quotes (or within $(...)) when the shell's output is re