# [PATCH] filter-branch: fix dash complaining about "Missing '))'"

2 messages from 2007-07-24 to 2007-07-24. Participants: René Scharfe, Johannes Schindelin.
Thread: https://gitlist.dev/t/9211

## René Scharfe, 2007-07-24 21:29

Subject: [PATCH] filter-branch: fix dash complaining about "Missing '))'"
Message-ID: <46A66F39.20507@lsrfire.ath.cx>
URL: https://gitlist.dev/e/46A66F39.20507%40lsrfire.ath.cx

```
On e.g. Ubuntu, dash is used as /bin/sh.  Unlike bash it parses
commands like

  a=$((echo stuff) | wc)

as an arithmetic expression while what we want is a subshell inside
a command substitution.  Resolve the ambiguity by placing a space
between the two opening parentheses.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0ff3475..b5fa449 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -298,7 +298,7 @@ do
 	# Assign the boundarie(s) in the set of rewritten commits
 	# as the replacement commit(s).
 	# (This would look a bit nicer if --not --stdin worked.)
-	for p in $((cd "$workdir"/../map; ls | sed "s/^/^/") |
+	for p in $( (cd "$workdir"/../map; ls | sed "s/^/^/") |
 		git rev-list $ref --boundary --stdin |
 		sed -n "s/^-//p")
 	do

```

## Johannes Schindelin, 2007-07-24 22:22

Subject: Re: [PATCH] filter-branch: fix dash complaining about "Missing '))'"
Message-ID: <Pine.LNX.4.64.0707242321470.14781@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0707242321470.14781%40racer.site
In-Reply-To: <46A66F39.20507@lsrfire.ath.cx>

```
Hi,

On Tue, 24 Jul 2007, Ren? Scharfe wrote:

> On e.g. Ubuntu, dash is used as /bin/sh.  Unlike bash it parses
> commands like
> 
>   a=$((echo stuff) | wc)
> 
> as an arithmetic expression while what we want is a subshell inside
> a command substitution.

Ah, well.  I think I should switch to Ubuntu, to suffer the same...

Ciao,
Dscho

```
