# Latest cogito broken with bash-3.1

10 messages from 2005-12-10 to 2005-12-12. Participants: Marcel Holtmann, Petr Baudis, Martin Langhoff, Linus Torvalds.
Thread: https://gitlist.dev/t/2793

## Marcel Holtmann, 2005-12-10 13:18

Subject: Latest cogito broken with bash-3.1
Message-ID: <1134220724.15125.4.camel@blade>
URL: https://gitlist.dev/e/1134220724.15125.4.camel%40blade

```
Hi Petr,

I have a Ubuntu Dapper running and since their update to the latest bash
version the cg-commit command (and maybe others) is broken. It reports:

GNU bash, version 3.1.0(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

The cogito is the latest from kernel.org and when calling cg-commit it
fails with this message:

cg-commit: line 200: syntax error near unexpected token `('
cg-commit: line 200: `       eval commitfiles=($(cat $filter | path_xargs git-diff-index -r -m HEAD -- | \'

I played a little bit with it and it seems all the eval statements are
broken with this bash version. I have no clue how to fix this, but maybe
you do.

Regards

Marcel

```

## Petr Baudis, 2005-12-11 00:11

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <20051211001106.GV22159@pasky.or.cz>
URL: https://gitlist.dev/e/20051211001106.GV22159%40pasky.or.cz
In-Reply-To: <1134220724.15125.4.camel@blade>

```
  Hello,

Dear diary, on Sat, Dec 10, 2005 at 02:18:44PM CET, I got a letter
where Marcel Holtmann <marcel@holtmann.org> said that...
> The cogito is the latest from kernel.org and when calling cg-commit it
> fails with this message:
> 
> cg-commit: line 200: syntax error near unexpected token `('
> cg-commit: line 200: `       eval commitfiles=($(cat $filter | path_xargs git-diff-index -r -m HEAD -- | \'
> 
> I played a little bit with it and it seems all the eval statements are
> broken with this bash version. I have no clue how to fix this, but maybe
> you do.

  it seems like the newer bash is stricter than the older versions in
some obscure regards. Quoting the eval arguments (which is the proper
thing to do anyway) fixed that particular problem; I've hit another
problem during a test commit wrt. whitespace separators - I've fixed
that too, and pushed out.

  Thanks,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

```

## Marcel Holtmann, 2005-12-11 08:31

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <1134289867.9541.9.camel@blade>
URL: https://gitlist.dev/e/1134289867.9541.9.camel%40blade
In-Reply-To: <20051211001106.GV22159@pasky.or.cz>

```
Hi Petr,

> > The cogito is the latest from kernel.org and when calling cg-commit it
> > fails with this message:
> > 
> > cg-commit: line 200: syntax error near unexpected token `('
> > cg-commit: line 200: `       eval commitfiles=($(cat $filter | path_xargs git-diff-index -r -m HEAD -- | \'
> > 
> > I played a little bit with it and it seems all the eval statements are
> > broken with this bash version. I have no clue how to fix this, but maybe
> > you do.
> 
>   it seems like the newer bash is stricter than the older versions in
> some obscure regards. Quoting the eval arguments (which is the proper
> thing to do anyway) fixed that particular problem; I've hit another
> problem during a test commit wrt. whitespace separators - I've fixed
> that too, and pushed out.

it's now working again. Thanks. What do you think about another release?
I haven't checked the other distributions yet, but I just saw that
Debian unstable also moved to version 3.1 of bash.

There exists also another problem with the new bash. It is the broken
pipe error from cg-log.

cg-log: line 141: echo: write error: Broken pipe

The line number varies depending how much you scrolled and when you
scrolled to the end no broken pipe error comes up. Do you have any idea
on how to deal with this. I saw your comment about that bash is broken
and the extra trap command, but it doesn't help. I never saw that
problem with older versions of bash.

Regards

Marcel

```

## Petr Baudis, 2005-12-12 00:26

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <20051212002631.GW22159@pasky.or.cz>
URL: https://gitlist.dev/e/20051212002631.GW22159%40pasky.or.cz
In-Reply-To: <1134289867.9541.9.camel@blade>

```
  Hello,

Dear diary, on Sun, Dec 11, 2005 at 09:31:07AM CET, I got a letter
where Marcel Holtmann <marcel@holtmann.org> said that...
> it's now working again. Thanks. What do you think about another release?
> I haven't checked the other distributions yet, but I just saw that
> Debian unstable also moved to version 3.1 of bash.

  yes, I was planning 0.16.1 on Sunday anyway. Going to tag it now.

> There exists also another problem with the new bash. It is the broken
> pipe error from cg-log.
> 
> cg-log: line 141: echo: write error: Broken pipe
> 
> The line number varies depending how much you scrolled and when you
> scrolled to the end no broken pipe error comes up. Do you have any idea
> on how to deal with this. I saw your comment about that bash is broken
> and the extra trap command, but it doesn't help. I never saw that
> problem with older versions of bash.

  Then that's quite funny, one-line broken pipe message has been always
there (in the past it looked much worse, we thankfully managed to bring
it down to this at least).

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

```

## Martin Langhoff, 2005-12-12 00:58

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <46a038f90512111658x5fe3198ey38515fc2745dd42b@mail.gmail.com>
URL: https://gitlist.dev/e/46a038f90512111658x5fe3198ey38515fc2745dd42b%40mail.gmail.com
In-Reply-To: <20051212002631.GW22159@pasky.or.cz>

```
On 12/12/05, Petr Baudis <pasky@suse.cz> wrote:
>   Then that's quite funny, one-line broken pipe message has been always
> there (in the past it looked much worse, we thankfully managed to bring
> it down to this at least).

I assume there's no reasonable workaround to that then? What would
take to get rid of that (say, if I had a boring weekend ;)?

cheers,


m

```

## Petr Baudis, 2005-12-12 00:59

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <20051212005944.GX22159@pasky.or.cz>
URL: https://gitlist.dev/e/20051212005944.GX22159%40pasky.or.cz
In-Reply-To: <46a038f90512111658x5fe3198ey38515fc2745dd42b@mail.gmail.com>

```
Dear diary, on Mon, Dec 12, 2005 at 01:58:00AM CET, I got a letter
where Martin Langhoff <martin.langhoff@gmail.com> said that...
> On 12/12/05, Petr Baudis <pasky@suse.cz> wrote:
> >   Then that's quite funny, one-line broken pipe message has been always
> > there (in the past it looked much worse, we thankfully managed to bring
> > it down to this at least).
> 
> I assume there's no reasonable workaround to that then?

The trapping is apparently the best we can do - at least I know of
nothing better.

> What would take to get rid of that (say, if I had a boring weekend ;)?

Fixing bash, IIRC - and more importantly, convincing its maintainers to
take the patch. ;-) Sometime in the spring someone even posted the exact
location in bash where this is broken.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

```

## Marcel Holtmann, 2005-12-12 09:30

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <1134379801.1468.5.camel@blade>
URL: https://gitlist.dev/e/1134379801.1468.5.camel%40blade
In-Reply-To: <20051212002631.GW22159@pasky.or.cz>

```
Hi Petr,

> > There exists also another problem with the new bash. It is the broken
> > pipe error from cg-log.
> > 
> > cg-log: line 141: echo: write error: Broken pipe
> > 
> > The line number varies depending how much you scrolled and when you
> > scrolled to the end no broken pipe error comes up. Do you have any idea
> > on how to deal with this. I saw your comment about that bash is broken
> > and the extra trap command, but it doesn't help. I never saw that
> > problem with older versions of bash.
> 
>   Then that's quite funny, one-line broken pipe message has been always
> there (in the past it looked much worse, we thankfully managed to bring
> it down to this at least).

I have some machines where I stopped installing the latest bash version
and they don't have this problem. With bash-2.05b.0 and bash-3.00.16 I
never (and really mean never) saw this problem.

It is not related to this, but the make-3.81beta3 breaks all my Debian
package rules and I don't have the slightest idea why. It seems that
they try to fix some Posix issues and make it worse then any better :(

Regards

Marcel

```

## Petr Baudis, 2005-12-12 10:40

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <20051212104039.GJ10680@pasky.or.cz>
URL: https://gitlist.dev/e/20051212104039.GJ10680%40pasky.or.cz
In-Reply-To: <1134379801.1468.5.camel@blade>

```
  Hi,

Dear diary, on Mon, Dec 12, 2005 at 10:30:01AM CET, I got a letter
where Marcel Holtmann <marcel@holtmann.org> said that...
> > > There exists also another problem with the new bash. It is the broken
> > > pipe error from cg-log.
> > > 
> > > cg-log: line 141: echo: write error: Broken pipe
> > > 
> > > The line number varies depending how much you scrolled and when you
> > > scrolled to the end no broken pipe error comes up. Do you have any idea
> > > on how to deal with this. I saw your comment about that bash is broken
> > > and the extra trap command, but it doesn't help. I never saw that
> > > problem with older versions of bash.
> > 
> >   Then that's quite funny, one-line broken pipe message has been always
> > there (in the past it looked much worse, we thankfully managed to bring
> > it down to this at least).
> 
> I have some machines where I stopped installing the latest bash version
> and they don't have this problem. With bash-2.05b.0 and bash-3.00.16 I
> never (and really mean never) saw this problem.

  this might be some Debian patches then. Indeed, with bash-3.00.16 on
both systems, the line is shown on my home Gentoo system but not on my
Debian machine at work. On RHEL at kernel.org the line is not printed
either. Hmm. So either it's not really bash what emits this (but what
then?) or most of the distributions override that stupid bash behaviour
with a patch already. And Debian didn't foreport the patch to bash-3.1.
Well, this would make the weekend research more interesting, at least.
;-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

```

## Marcel Holtmann, 2005-12-12 11:02

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <1134385342.1468.27.camel@blade>
URL: https://gitlist.dev/e/1134385342.1468.27.camel%40blade
In-Reply-To: <20051212104039.GJ10680@pasky.or.cz>

```
Hi Petr,

> > > > There exists also another problem with the new bash. It is the broken
> > > > pipe error from cg-log.
> > > > 
> > > > cg-log: line 141: echo: write error: Broken pipe
> > > > 
> > > > The line number varies depending how much you scrolled and when you
> > > > scrolled to the end no broken pipe error comes up. Do you have any idea
> > > > on how to deal with this. I saw your comment about that bash is broken
> > > > and the extra trap command, but it doesn't help. I never saw that
> > > > problem with older versions of bash.
> > > 
> > >   Then that's quite funny, one-line broken pipe message has been always
> > > there (in the past it looked much worse, we thankfully managed to bring
> > > it down to this at least).
> > 
> > I have some machines where I stopped installing the latest bash version
> > and they don't have this problem. With bash-2.05b.0 and bash-3.00.16 I
> > never (and really mean never) saw this problem.
> 
>   this might be some Debian patches then. Indeed, with bash-3.00.16 on
> both systems, the line is shown on my home Gentoo system but not on my
> Debian machine at work. On RHEL at kernel.org the line is not printed
> either. Hmm. So either it's not really bash what emits this (but what
> then?) or most of the distributions override that stupid bash behaviour
> with a patch already. And Debian didn't foreport the patch to bash-3.1.

I just verified that on my Ubuntu Dapper system where I had a copy of
the old bash package lying around. The bash-3.0 works fine, but the
bash-3.1 produces this error. So it is definitely bash related.

Regards

Marcel

```

## Linus Torvalds, 2005-12-12 15:32

Subject: Re: Latest cogito broken with bash-3.1
Message-ID: <Pine.LNX.4.64.0512120725350.15597@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0512120725350.15597%40g5.osdl.org
In-Reply-To: <1134385342.1468.27.camel@blade>

```


On Mon, 12 Dec 2005, Marcel Holtmann wrote:
> 
> I just verified that on my Ubuntu Dapper system where I had a copy of
> the old bash package lying around. The bash-3.0 works fine, but the
> bash-3.1 produces this error. So it is definitely bash related.

It's been around forever, and it's a bash default installation issue. It's 
just that all sane distributions will change the default.

Sounds like debian forgot to do that when upgrading to bash-3.1.

The magic incantation is hidden in the bash FAQ (E2):

	You can build a version of bash that will not report SIGPIPE errors
	by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
	config-top.h.

and I still don't understand why it's not the default. Oh, well.

		Linus

```
