# Re: [PATCH] Avoid using non-portable `echo -n` in tests.

4 messages from 2008-10-31 to 2008-10-31. Participants: Francis Galiegue, Junio C Hamano, Ian Hilt.
Thread: https://gitlist.dev/t/16114

## Francis Galiegue, 2008-10-31 19:50

Subject: Re: [PATCH] Avoid using non-portable `echo -n` in tests.
Message-ID: <200810312050.31167.fg@one2team.net>
URL: https://gitlist.dev/e/200810312050.31167.fg%40one2team.net

```
Le Friday 31 October 2008 19:39:33 Jeff King, vous avez écrit :
[...]
>
> Agreed, and actually I found such a bashism (test ==) last week (though
> of course it also broke on FreeBSD).
>

As for bash-isms, a hunt for $(...) also looks necessary...

$ grep -rl '\$([^)]\+)' $(find -type f)|wc -l
272

Unless I'm mistaken (and I probably am), the $(...) construct is 
bash-specific, isn't it?

-- 
fge

```

## Junio C Hamano, 2008-10-31 20:10

Subject: Re: [PATCH] Avoid using non-portable `echo -n` in tests.
Message-ID: <7vbpx08r1d.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vbpx08r1d.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <200810312050.31167.fg@one2team.net>

```
Francis Galiegue <fg@one2team.net> writes:

> Unless I'm mistaken (and I probably am), the $(...) construct is 
> bash-specific, isn't it?

You are.

```

## Ian Hilt, 2008-10-31 20:11

Subject: Re: [PATCH] Avoid using non-portable `echo -n` in tests.
Message-ID: <20081031201127.GA21345@maintenance05.msc.mcgregor-surmount.com>
URL: https://gitlist.dev/e/20081031201127.GA21345%40maintenance05.msc.mcgregor-surmount.com
In-Reply-To: <200810312050.31167.fg@one2team.net>

```
On Fri, Oct 31, 2008 at 08:50:31PM +0100, Francis Galiegue wrote:
> Le Friday 31 October 2008 19:39:33 Jeff King, vous avez écrit :
> [...]
> >
> > Agreed, and actually I found such a bashism (test ==) last week (though
> > of course it also broke on FreeBSD).
> >
> 
> As for bash-isms, a hunt for $(...) also looks necessary...
> 
> $ grep -rl '\$([^)]\+)' $(find -type f)|wc -l
> 272
> 
> Unless I'm mistaken (and I probably am), the $(...) construct is 
> bash-specific, isn't it?

Nope.  Read section 2.6.3 Command Substitution here,

<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html>

```

## Francis Galiegue, 2008-10-31 20:30

Subject: Re: [PATCH] Avoid using non-portable `echo -n` in tests.
Message-ID: <200810312130.03037.fg@one2team.net>
URL: https://gitlist.dev/e/200810312130.03037.fg%40one2team.net
In-Reply-To: <20081031201127.GA21345@maintenance05.msc.mcgregor-surmount.com>

```
Le Friday 31 October 2008 21:11:27 Ian Hilt, vous avez écrit :
[...]
> >
> > Unless I'm mistaken (and I probably am), the $(...) construct is
> > bash-specific, isn't it?
>
> Nope.  Read section 2.6.3 Command Substitution here,
>
> <http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html>

My bad, then. I'm too "old-school", I guess ;)

-- 
fge

```
