Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 2008 15:24:28 +0100
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Cc:        Tim Judd <tajudd@gmail.com>
Subject:   Re: shell scripting problems
Message-ID:  <200811291524.28632.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <ade45ae90811282058k8215023r80e497fa5d857c40@mail.gmail.com>
References:  <ade45ae90811282058k8215023r80e497fa5d857c40@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 29 November 2008 05:58:44 Tim Judd wrote:

> In the shell script, i have a
>   pkg_info -qLx "^$PKG-[0-9,._]+$"
> also tried (-X)tended regex instead of the standard rege(-x).

pkg_info -qLx "^${PKG}-[0-9,\._]+\$"
                -- 1--           -2-

@1: shell evaluates before regex. Use braces so that end of variable is 
explicit
@2: this shouldn't be evaluated by the shell, so escape it with a backslash. 
It's passed as dollar sign to the command.

Also, I'm relatively sure it needs -X for the + sign, but haven't tested.
-- 
Mel

Problem with today's modular software: they start with the modules
    and never get to the software part.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811291524.28632.fbsd.questions>