From owner-freebsd-questions@FreeBSD.ORG Sat Nov 29 08:40:51 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7B481065672 for ; Sat, 29 Nov 2008 08:40:51 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1318FC16 for ; Sat, 29 Nov 2008 08:40:51 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id mAT8eoSf075547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 29 Nov 2008 00:40:50 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id mAT8eop5075546; Sat, 29 Nov 2008 00:40:50 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA07419; Sat, 29 Nov 08 00:33:51 PST Date: Sat, 29 Nov 2008 00:37:26 -0800 From: perryh@pluto.rain.com To: tajudd@gmail.com Message-Id: <4930ff46.LVjmMuGTfhiq3N0y%perryh@pluto.rain.com> References: In-Reply-To: User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: shell scripting problems X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2008 08:40:51 -0000 > 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,._]+"'$'