Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 2008 00:37:26 -0800
From:      perryh@pluto.rain.com
To:        tajudd@gmail.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: shell scripting problems
Message-ID:  <4930ff46.LVjmMuGTfhiq3N0y%perryh@pluto.rain.com>
In-Reply-To: <ade45ae90811282058k8215023r80e497fa5d857c40@mail.gmail.com>
References:  <ade45ae90811282058k8215023r80e497fa5d857c40@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> In the shell script, i have a
>   pkg_info -qLx "^$PKG-[0-9,._]+$"
> also tried (-X)tended regex instead of the standard rege(-x).
>
> sh keeps erroring out saying various $" isn't a valid variable
> name ...

Both sh and csh will try to treat $ inside of "" as a variable
reference.  Does it work any better if you enclose the $ in ''
instead?

If you need the first $ to be a variable reference and the second
to be used literally, you may need to do something like

  "^$PKG-[0-9,._]+"'$'



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4930ff46.LVjmMuGTfhiq3N0y%perryh>