From owner-freebsd-questions@FreeBSD.ORG Sat Nov 29 05:18:49 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 23B2E106564A for ; Sat, 29 Nov 2008 05:18:49 +0000 (UTC) (envelope-from tajudd@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.freebsd.org (Postfix) with ESMTP id A3C2A8FC0A for ; Sat, 29 Nov 2008 05:18:48 +0000 (UTC) (envelope-from tajudd@gmail.com) Received: by nf-out-0910.google.com with SMTP id h3so897854nfh.33 for ; Fri, 28 Nov 2008 21:18:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=azVUJtMF1tS8LqhDZwX1hXfpguVy9vGSSIXGodAAMQQ=; b=xgJDccXT2rSyVTMITrzCE2PISx+QObdUj0JNSKR9QIaVsjlsWOCpv0XgT0yKdaFLwK W+RyOdFI4CjejYz6QEmBVRblUsDi1E+ErC4BhGCVo9jYDwMpAC+zJ/ReaoMsCATRSY3a U3913MPmofzAhXo47Z9+fsBkxZUwU1r6Bdrx4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=rjQFrMXzZXprEVP8UyPIwbUcTsCHgaCk5+cNsAem/h6ZShDFYHZgZ9MSqj6MI8FB8V Hi1ilZi0ymlvegmM9Gf2P2gMHJEiqDWQx3FDseUXBNPAggTkH6C3ImPA4nawVUnGJmc8 JOD34sLLsj1JXVvM0h4PsqtTK7GNzDAOv2zvI= Received: by 10.210.40.10 with SMTP id n10mr9778857ebn.13.1227934724349; Fri, 28 Nov 2008 20:58:44 -0800 (PST) Received: by 10.210.17.12 with HTTP; Fri, 28 Nov 2008 20:58:44 -0800 (PST) Message-ID: Date: Fri, 28 Nov 2008 21:58:44 -0700 From: "Tim Judd" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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 05:18:49 -0000 Hi all, I've been trying for a few weeks to try to get this to work, and the /bin/sh keeps snagging the command line before passing it to pkg_info I'll use a different shell if I need to, but since I got everything except this one thing working, i'd rather keep it in sh 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, or pkg_info doesn't find the anything there. And it does exist. This all came around with me trying to automatically update a bunch of ports. xorg-fonts is outdated, but xorg-fonts-100dpi or xorg-fonts-75dpi isn't. So the regex returns multiple values (as above). I just want the first, hence the anchors. Any ideas on how to get sh to let pkg_info see everything? Various escaping around the end $ just doesn't work. I'll keep working on it, but i'd like to see how you all would suggest getting it to work. Thanks!