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

[PATCH] Use character class for sed expression instead of \s

From
Ben Walton <bdwalton@gmail.com>
Date
Oct 25, 2012, 15:58 UTC
Message-ID
<1351180699-24695-1-git-send-email-bdwalton@gmail.com>
In-Reply-To
<508935CB.9020408@web.de>

Sed on Mac OS X doesn't handle \s in a sed expressions so use a more portable character set expression instead.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
---
Hi Torsten,

I think this would be a nicer fix for the issue although your solution should work as well.

Thanks -Ben

 t/t9401-git-cvsserver-crlf.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index cdb8360..1c5bc84 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -46,7 +46,7 @@ check_status_options() {
 	echo "Error from cvs status: $1 $2" >> "${WORKDIR}/marked.log"
 	return 1;
     fi
-    got="$(sed -n -e 's/^\s*Sticky Options:\s*//p' "${WORKDIR}/status.out")"
+    got="$(sed -n -e 's/^[ 	]*Sticky Options:[ 	]*//p' "${WORKDIR}/status.out")"
     expect="$3"
     if [ x"$expect" = x"" ] ; then
 	expect="(none)"
-- 
1.7.9.5
Previous: Torsten BögershausenNext: Brian Gernhardt
Message 5 of 10 in “t9401 fails with OS X sed”
  1. Brian GernhardtOct 25, 2012
  2. Geert BoschOct 25, 2012
  3. Jeff KingOct 25, 2012
  4. Torsten BögershausenOct 25, 2012
  5. Use character class for sed expression instead of \sBen Walton, Oct 25, 2012
  6. Brian GernhardtOct 25, 2012
  7. Torsten BögershausenOct 25, 2012
  8. Ben WaltonOct 25, 2012
  9. Torsten BögershausenOct 25, 2012
  10. Jeff KingOct 26, 2012

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.