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

next in thread | previous in thread | raw e-mail | index | archive | help
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@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,._]+"'$'
>



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