[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to match regex in bash? (any character)

From: Greg Wooledge
Subject: Re: How to match regex in bash? (any character)
Date: Thu, 29 Sep 2011 08:22:09 -0400
User-agent: Mutt/

On Wed, Sep 28, 2011 at 12:43:01PM -0800, Roger wrote:
> Seems I used 'man regex' as well here.  AKA regex(3).  But I did
> realize this a few weeks ago; the real regex description being 'man 7 regex'.
> The Bash Manual Page denotes only regex(3).

You're relatively fortunate that it's *that* easy to find on Linux.  On
Linux, regex(3) points directly to regex(7), and you're done.

On HP-UX, regex(3X) points to regcomp(3C) which points to regexp(5) which
contains the actual definitions.

On OpenBSD, regex(3) doesn't even *have* a SEE ALSO section; it's a dead
end.  And regcomp(3) is the same page as regex(3), so that doesn't help
either.  One would have to backtrack entirely, perhaps to grep(1).
However, buried deep in the regex(3) page is a reference to re_format(7)
(not even boldface).  And re_format(7) has the definitions, but getting
there takes perseverance.  (For the record, grep(1) does point straight
to re_format(7).)

So you see, bash(1) *cannot* just link directly to regex(7), because
that's not actually the correct final destination on most operating
systems.  It's only correct on Linux.  Bash uses the regex(3) library
interface, so that is the correct place for bash to refer the reader.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]