Skip to contentSkip to conversation

filter-branch: fix dash complaining about "Missing '))'"

PATCH In review René Scharfe 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 filter-branch: fix dash complaining about "Missing '))'"

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.

---

git-filter-branch.sh +1 -1
index 0ff3475..b5fa449 100755
@@ -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
#1 lore raw

Hi,

Quoted 7 lines · Ren? Scharfe

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