threads / patch / 3680

patchAdd missing semicolon to sed command.

Subject: [PATCH] Add missing semicolon to sed command.

## tl;dr

2 messages between Mar 20, 2006 and Mar 20, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Shawn Pearce· Mar 20, 2006, 00:18 UTC · lore

generate-cmdlist.sh is giving errors messages from sed on Mac OS 10.4 due to a missing semicolon.

---
 generate-cmdlist.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

base f81e7c626f34658289594386b0273755f47912a2 last 09913c10d93adbfa61138b7ac7ae6a8a210aa29f

Show changes to generate-cmdlist.sh +1 −1
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index 6ee85d5..76ba49c 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -42,7 +42,7 @@ EOF
 while read cmd
 do
     sed -n "/NAME/,/git-$cmd/H;
-	    \$ {x; s/.*git-$cmd - \\(.*\\)/  {\"$cmd\", \"\1\"},/; p}" \
+	    \$ {x; s/.*git-$cmd - \\(.*\\)/  {\"$cmd\", \"\1\"},/; p;}" \
 	"Documentation/git-$cmd.txt"
 done
 echo "};"
-- 
1.2.4.g41f6
Junio C Hamano· Mar 20, 2006, 02:15 UTC · re: Shawn Pearce · lore

Re: [PATCH] Add missing semicolon to sed command.

Shawn Pearce <spearce@spearce.org> writes:
> generate-cmdlist.sh is giving errors messages from sed on Mac OS
> 10.4 due to a missing semicolon.

I'll take this patch for now, but I've heard a horror story that some other vintage of sed apparently does not like multiple commands separated by semicolons at all, and I've been training myself to do this kind of thing always as multi-line sed script, like this:

     sed -n '
     /NAME/,/git-'"$cmd"'/H
     ${
            x
            s/.*git-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
	    p
     }' "Documentation/git-$cmd.txt"

← back to recent threads