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

3 messages from 2013-04-07 to 2013-04-07. Participants: Torsten Bögershausen, Felipe Contreras, Eric Sunshine.
Thread: https://gitlist.dev/t/33414

## Torsten Bögershausen, 2013-04-07 08:48

Subject: [PATCH] remote-helpers/test-bzr.sh: do not use grep \s
Message-ID: <201304071048.31790.tboegi@web.de>
URL: https://gitlist.dev/e/201304071048.31790.tboegi%40web.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

```

## Felipe Contreras, 2013-04-07 09:02

Subject: Re: [PATCH] remote-helpers/test-bzr.sh: do not use grep \s
Message-ID: <CAMP44s06=KCDfQuK1t2ZURoOzmF69pDXF0G6eji6EsiMAoBLbQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s06%3DKCDfQuK1t2ZURoOzmF69pDXF0G6eji6EsiMAoBLbQ%40mail.gmail.com
In-Reply-To: <201304071048.31790.tboegi@web.de>

```
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

```

## Eric Sunshine, 2013-04-07 09:04

Subject: Re: [PATCH] remote-helpers/test-bzr.sh: do not use grep \s
Message-ID: <CAPig+cQVcD_Ba2ZPvi0=GcBVhn_eHQeeAukm427kK=AnDSpMow@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcQVcD_Ba2ZPvi0%3DGcBVhn_eHQeeAukm427kK%3DAnDSpMow%40mail.gmail.com
In-Reply-To: <201304071048.31790.tboegi@web.de>

```
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>

```
