shell scripting problems

Tim Judd tajudd at gmail.com
Sat Nov 29 17:19:05 PST 2008


This seems to be the ticket.  I'll be watching it but now I have an example
on how to dual-quote a string.

Thanks very much, Perry

On Sat, Nov 29, 2008 at 1:37 AM, <perryh at pluto.rain.com> 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).
> >
> > 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,._]+"'$'
>


More information about the freebsd-questions mailing list