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

[PATCH] cogito: Escape $* in cg admin-setuprepro to fix problems with older bash versions

From
Mmcdmx <mcdmx@users.sf.net>
Date
Mar 15, 2007, 13:53 UTC
Message-ID
<etbj4u$sh6$1@sea.gmane.org>

Using $* in the _Here_ document at the end of cg-admin-setuprepro seriously confuses Bash v2.0.5b and causes lines produced by the _Here_ document to look something like

##  EEnnaabbllee ggiitt--uuppddaattee--sseerrvveerr--iinnffoo

The problem does not occur with Bash 3.1.x. The patch below fixes this by escaping the dollar in "$*".

diff --git a/cg-admin-setuprepo b/cg-admin-setuprepo
index d407798..a37b6ae 100755
--- a/cg-admin-setuprepo
+++ b/cg-admin-setuprepo
@@ -91,7 +91,7 @@ fi
 _git="$uri"
 cat <<_SCRIPT_EOF_ | $shell $shellarg

-die() { echo "$*" >&2; exit 1; }
+die() { echo "\$*" >&2; exit 1; }

 export GIT_DIR="$uri"
Message 1 of 1 in “cogito: Escape $* in cg admin-setuprepro to fix problems with older bash versions”
  1. cogito: Escape $* in cg admin-setuprepro to fix problems with older bash versionsmcdmx, Mar 15, 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.