* [PATCH] remote-helpers/test-bzr.sh: do not use grep \s
@ 2013-04-07 8:48 Torsten Bögershausen
2013-04-07 9:02 ` Felipe Contreras
2013-04-07 9:04 ` Eric Sunshine
0 siblings, 2 replies; 3+ messages in thread
From: Torsten Bögershausen @ 2013-04-07 8:48 UTC (permalink / raw)
To: git; +Cc: felipe.contreras, tboegi
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] remote-helpers/test-bzr.sh: do not use grep \s
2013-04-07 8:48 [PATCH] remote-helpers/test-bzr.sh: do not use grep \s Torsten Bögershausen
@ 2013-04-07 9:02 ` Felipe Contreras
2013-04-07 9:04 ` Eric Sunshine
1 sibling, 0 replies; 3+ messages in thread
From: Felipe Contreras @ 2013-04-07 9:02 UTC (permalink / raw)
To: Torsten Bögershausen; +Cc: git
On Sun, Apr 7, 2013 at 3:48 AM, Torsten Bögershausen <tboegi@web.de> wrote:
> 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.
If "\t" is not possible, I would rather use [:space:].
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] remote-helpers/test-bzr.sh: do not use grep \s
2013-04-07 8:48 [PATCH] remote-helpers/test-bzr.sh: do not use grep \s Torsten Bögershausen
2013-04-07 9:02 ` Felipe Contreras
@ 2013-04-07 9:04 ` Eric Sunshine
1 sibling, 0 replies; 3+ messages in thread
From: Eric Sunshine @ 2013-04-07 9:04 UTC (permalink / raw)
To: Torsten Bögershausen; +Cc: Git List, Felipe Contreras
On Sun, Apr 7, 2013 at 4:48 AM, Torsten Bögershausen <tboegi@web.de> wrote:
> Using grep "devel\s\+3:" to find at least one whitspace
s/whitspace/whitespace/
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-07 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-07 8:48 [PATCH] remote-helpers/test-bzr.sh: do not use grep \s Torsten Bögershausen
2013-04-07 9:02 ` Felipe Contreras
2013-04-07 9:04 ` Eric Sunshine
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).