From: Junio C Hamano Date: Thu, 26 Feb 2009 22:37:44 GMT Subject: Re: [PATCH] t5540-http-push.sh: avoid non-portable grep -P Message-ID: <7veixkrfif.fsf@gitster.siamese.dyndns.org> In-Reply-To: <76718490902261419r314f6ea4r5eb02e9b5b0c40d0@mail.gmail.com> Jay Soffian writes: > On Thu, Feb 26, 2009 at 4:48 PM, Junio C Hamano wrote: >> So perhaps define a variable: >> >> good="\"\(PUT\|MOVE\) .*/objects/$x2/${x38}_$x40 HTTP/[.0-9]*" 20[0-9]\"" >> >> and grep for it? > > Hmpfh. According to my re_format man page: > > Obsolete (``basic'') regular expressions differ in several respects. > `|' is an ordinary character and there is no equivalent for its > functionality. Ahh, you are right; there is no '|'-alternation in BRE. We of course could do something like: good=" .*/objects/$x2/${x38}_$x40 HTTP/[.0-9]*" 20[0-9]\"" grep -e "\"PUT $good" -e "\"MOVE $good" But that's too ugly. I don't mind Perl as we already depend on it; the looseness of the regexp stil bothers me somewhat, though...