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

[PATCH] remote-helpers/test-bzr.sh: do not use grep \s

From
Torsten Bögershausen <tboegi@web.de>
Date
Apr 7, 2013, 08:48 UTC
Message-ID
<201304071048.31790.tboegi@web.de>

Using grep "devel\s\+3:" to find at least one whitspace is not portable on all grep versions: Not all grep versions understand "\s" as a "whitespace".

Use a literal TAB followed by SPACE like this [ ] instead. The + as a qualifier for "one or more" is not a basic regular expression: use egrep instead of grep.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 contrib/remote-helpers/test-hg.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh
index 5f81dfa..7bb81f2 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/contrib/remote-helpers/test-hg.sh
@@ -115,7 +115,7 @@ test_expect_success 'update bookmark' '
   git push
   ) &&
 
-  hg -R hgrepo bookmarks | grep "devel\s\+3:"
+  hg -R hgrepo bookmarks | egrep "devel[	 ]+3:"
 '
 
 test_done
-- 
1.8.2.341.g543621f
Next: Felipe Contreras
Message 1 of 3 in “remote-helpers/test-bzr.sh: do not use grep \s”
  1. remote-helpers/test-bzr.sh: do not use grep \sTorsten Bögershausen, Apr 7, 2013
  2. Felipe ContrerasApr 7, 2013
  3. Eric SunshineApr 7, 2013

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.