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

[PATCH] t/t9001-send-email.sh: ensure generated script is executed with $SHELL_PATH

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jun 22, 2009, 17:32 UTC
Message-ID
<0aBbhbpQqrYrkmoZ4FLobIiu7r9gRqhySR3zL0Ll2nRDg9pCmQ_amb4Z4AZXxbULu3EPW-03YA8@cipher.nrlssc.navy.mil>
From: Brandon Casey <drafnel@gmail.com>

If the shell is not specified using the '#!' notation, then the OS will use '/bin/sh' to execute the script which may not produce the desired results. In particular, /bin/sh on Solaris interprets '^' specially which has an affect on the sed command that this patch touches.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
 t/t9001-send-email.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index fb7d9f3..7b4cf55 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -152,7 +152,9 @@ test_expect_success 'cccmd works' '
 	clean_fake_sendmail &&
 	cp $patches cccmd.patch &&
 	echo cccmd--cccmd@example.com >>cccmd.patch &&
-	echo sed -n s/^cccmd--//p \"\$1\" > cccmd-sed &&
+	{ echo "#!$SHELL_PATH"
+	  echo sed -n s/^cccmd--//p \"\$1\"
+	} > cccmd-sed &&
 	chmod +x cccmd-sed &&
 	git send-email \
 		--from="Example <nobody@example.com>" \
-- 
1.6.3.1.24.g152f4
Message 1 of 1 in “t/t9001-send-email.sh: ensure generated script is executed with $SHELL_PATH”
  1. t/t9001-send-email.sh: ensure generated script is executed with $SHELL_PATHBrandon Casey, Jun 22, 2009

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.