git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Jul 24, 2007, 21:29 UTC
Message-ID
<46A66F39.20507@lsrfire.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
Next: Johannes Schindelin
Message 1 of 2 in “filter-branch: fix dash complaining about "Missing '))'"”
  1. filter-branch: fix dash complaining about "Missing '))'"René Scharfe, Jul 24, 2007
  2. Johannes SchindelinJul 24, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.