This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin bash regexp matching doesn't treat "\b" properly


aputerguy schrieb:
Hugh Myers:
This might come across as slightly smart-assed, but if you wrote your
script in Perl, you wouldn't have the platform problem, nor the
word-boundary problem. True you would have a Perl problem, but that
would still be several orders of magnitude easier than trying to have
Linux, Cygwin and Posix come to agreement!! :)

As soon as Perl becomes the default shell...


Seriously, there are times to use Perl and times not to...
But launching perl seems a bit of overkill when I just have to do a simple
match in a .bashrc script or when I need a small shell script wrapper.

Perhaps it is an option to use the "extglob shell option" of the bash shell in the script.
Then you can use a pattern-list in the statement. Something like
[[ ${foo} = @(bar|${foo}|sds) ]]
You have to build the pattern-list in a little bit different way, because of the separator "|".


This works in ksh and bash ;-)
I use this on AIX, HP-UX, Solaris, Linux and Cygwin with bash and KSH.

Dirk



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]