Date: Sat, 29 Nov 2008 14:34:22 +0530 From: =?utf-8?B?4KSG4KS24KWA4KS3IOCktuClgeCkleCljeCksg==?= Ashish Shukla <wahjava.ml@gmail.com> To: Tim Judd <tajudd@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: shell scripting problems Message-ID: <20081129090422.GA23908@chateau.d.lf> In-Reply-To: <ade45ae90811282058k8215023r80e497fa5d857c40@mail.gmail.com> References: <ade45ae90811282058k8215023r80e497fa5d857c40@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] In <ade45ae90811282058k8215023r80e497fa5d857c40@mail.gmail.com>, Tim Judd wrote: >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. 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 amd64 ---->8---->8---- And as you can see in above paste, 'sh' doesn't evaluate $" as variable as it has evaluated $PKG as variable. this works with 'sh' shipped with 8.0-CURRENT. Maybe some issue with your 'sh'. HTH -- Ashish Shukla [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkkxBZYACgkQHy+EEHYuXnRCCwCfQyV8Do0BuNjlzlgNhL5AEs/D sqIAoNCpE96k//Ne3xms9kVEm7WFIkyw =5CfB -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081129090422.GA23908>
