From owner-freebsd-questions@FreeBSD.ORG Sat Nov 29 09:02:45 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 3FD401065670 for ; Sat, 29 Nov 2008 09:02:45 +0000 (UTC) (envelope-from wahjava@gmail.com) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.185]) by mx1.freebsd.org (Postfix) with ESMTP id AA7A28FC14 for ; Sat, 29 Nov 2008 09:02:44 +0000 (UTC) (envelope-from wahjava@gmail.com) Received: by ti-out-0910.google.com with SMTP id a1so1131049tib.3 for ; Sat, 29 Nov 2008 01:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:x-face:x-attribution:x-os-kernel :x-os-version:x-os-architecture:x-uptime:x-url:x-mail-morse :x-openpgp-fingerprint:x-openpgp-id:organization:user-agent:sender; bh=l2AYP4JYob8zfE+strWm9WBuY8ZdBSWloY1qv9ZRuBE=; b=WW4YUGQXQ0cSFdsu2/GiCmP/WyJCNtSbaXY0G4E6gaAlPIeeZXM2WRvLKAMbC5MzmN WvTHUGwfxwjOIBQtfh4dTD3C0FK3wUgXa6p3crSYX2PoqOy/M9FXHi/iin9byKa1X1+9 P1IixDCXHZAbMLHLf298E1EmmTL0P8YYfueS0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to:x-face :x-attribution:x-os-kernel:x-os-version:x-os-architecture:x-uptime :x-url:x-mail-morse:x-openpgp-fingerprint:x-openpgp-id:organization :user-agent:sender; b=B+A9FKhFKvGXEXd7t4plNRCF4WO5vNA8fVh0iKZErfFtMe8npEe2Sk+4Cay0xpP/BI SgBg09sMVa2qLP/3jGN16Dtd96Spo0hGcWjk3akThxW3zuanYdt7J2+w50UyzwLkkWW1 L8FXVU5aXVcwpkyZ6t9jXQ4VyAb9VRt7q3Whg= Received: by 10.110.61.16 with SMTP id j16mr8575409tia.16.1227949363665; Sat, 29 Nov 2008 01:02:43 -0800 (PST) Received: from chateau.d.lf ([122.162.28.219]) by mx.google.com with ESMTPS id i9sm4317590tid.9.2008.11.29.01.02.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 29 Nov 2008 01:02:42 -0800 (PST) Date: Sat, 29 Nov 2008 14:34:22 +0530 From: =?utf-8?B?4KSG4KS24KWA4KS3IOCktuClgeCkleCljeCksg==?= Ashish Shukla To: Tim Judd Message-ID: <20081129090422.GA23908@chateau.d.lf> Mail-Followup-To: Tim Judd , freebsd-questions@freebsd.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: X-Face: )vGQ9yK7Y$Flebu1C>(B\gYBm)[$zfKM+p&TT[[JWl6:]S>cc$%-z7-`46Zf0B*syL.C]oCq[upTG~zuS0.$"_%)|Q@$hA=9{3l{%u^h3jJ^Zl; t7 X-Attribution: =?utf-8?B?4KSG4KS24KWA4KS3?= X-OS-Kernel: Linux X-OS-Version: 2.6.25-gentoo-r7 X-OS-Architecture: x86_64 X-Uptime: 14:11:05 up 2:29, 2 users, load average: 1.86, 2.39, 2.53 X-URL: http://wahjava.wordpress.com/ X-Mail-Morse: .-- .- .... .--- .- ...- .- .--.-. --. -- .- .. .-.. .-.-.- -.-. --- -- X-OpenPGP-Fingerprint: 1E00 4679 77E4 F8EE 2E4B 56F2 1F2F 8410 762E 5E74 X-OpenPGP-ID: 762E5E74 Organization: /\/0/\/3 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: =?UTF-8?B?4KSG4KS24KWA4KS3IOCktuClgeCkleCljeCksiBBc2hpc2ggU2h1a2xh?= 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 09:02:45 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In , Tim Judd w= rote: >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 ca= me >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. I tried following on my 8.0-CURRENT box: ----8<----8<---- abbe [~] monte-cristo% exec sh $ echo "^$PKG-[0-9,._]+$" ^-[0-9,._]+$ $ uname -a FreeBSD monte-cristo.france 8.0-CURRENT FreeBSD 8.0-CURRENT #21: Mon Nov 10= 21:19:13 IST 2008 root@monte-cristo.france:/usr/obj/usr/src/sys/ULE a= md64 ---->8---->8---- And as you can see in above paste, 'sh' doesn't evaluate $" as variable as= =20 it has evaluated $PKG as variable. this works with 'sh' shipped with=20 8.0-CURRENT. Maybe some issue with your 'sh'. HTH --=20 Ashish Shukla --0F1p//8PRICkK4MW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkxBZYACgkQHy+EEHYuXnRCCwCfQyV8Do0BuNjlzlgNhL5AEs/D sqIAoNCpE96k//Ne3xms9kVEm7WFIkyw =5CfB -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW--