shell scripting problems

Mel fbsd.questions at rachie.is-a-geek.net
Sat Nov 29 06:24:30 PST 2008


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.


More information about the freebsd-questions mailing list