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

[PATCH 2/3] Fix sed usage in tests to work around broken xpg4/sed on Solaris

From
Ben Walton <bdwalton@gmail.com>
Date
Jul 19, 2015, 18:00 UTC
Message-ID
<1437328836-19156-3-git-send-email-bdwalton@gmail.com>
In-Reply-To
<1437328836-19156-1-git-send-email-bdwalton@gmail.com>

The space following the last / in a sed command caused Solaris' xpg4/sed to fail, claiming the program was garbled and exit with status 2:

% echo 'foo' | /usr/xpg4/bin/sed -e 's/foo/bar/ ' sed: command garbled: s/foo/bar/ % echo $? 2

Fix this by simply removing the unnecessary space.
Signed-off-by: Ben Walton <bdwalton@gmail.com>
---
 t/t5601-clone.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 8299d14..8b7f8e1 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -445,7 +445,7 @@ test_expect_success 'clone ssh://host.xz:22/~repo' '
 #IPv6
 for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]:
 do
-	ehost=$(echo $tuah | sed -e "s/1]:/1]/ " | tr -d "$squarebrackets")
+	ehost=$(echo $tuah | sed -e "s/1]:/1]/" | tr -d "$squarebrackets")
 	test_expect_success "clone ssh://$tuah/home/user/repo" "
 	  test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo
 	"
-- 
2.1.4
Previous: Eric SunshineNext: Ben Walton
Message 4 of 6 in “Adapt some tests to work around broken Solaris tools”
  1. Ben WaltonJul 19, 2015
  2. 1/3 Modify tr expressions so that xpg4/tr handles it on SolarisBen Walton, Jul 19, 2015
  3. Eric SunshineJul 19, 2015
  4. 2/3 Fix sed usage in tests to work around broken xpg4/sed on SolarisBen Walton, Jul 19, 2015
  5. 3/3 Fix sed usage in tests to work around broken xpg4/sed on SolarisBen Walton, Jul 19, 2015
  6. Johannes SixtJul 19, 2015

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.