| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL |
| X-Spam-Check-By: | sourceware.org |
| Date: | Fri, 18 Mar 2011 00:07:43 +0100 |
| From: | David Sastre <d DOT sastre DOT medina AT gmail DOT com> |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: Problems with the new base-files-4.0-5? |
| Message-ID: | <20110317230743.GB22548@jethro.local.lan> |
| References: | <4D828E8E DOT 6020607 AT alice DOT it> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <4D828E8E.6020607@alice.it> |
| User-Agent: | Mutt/1.5.20 (2009-06-14) |
| X-IsSubscribed: | yes |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
--nVMJ2NtxeReIH9PS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Thu, Mar 17, 2011 at 11:43:26PM +0100, Angelo Graziosi wrote:
> David Sastre wrote:
> >Please test if
> >
> >[ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=3D${PRINTER%%,*}
>=20
> No, I think.
>=20
> I get:
>=20
> $ cat test_pr.sh
> #!/bin/bash
>=20
> p=3D'/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows
> NT/CurrentVersion/Windows/Device'
>=20
> [ -e "${p}" ] && read -r PRINTER < "${p}" && PRINTER=3D${PRINTER%%,*}
>=20
> echo 'echo $PRINTER'
> echo $PRINTER
>=20
> $ ./test_pr.sh
> echo $PRINTER
> HP Deskjet 3740 Series,winspool,Ne03:
> ----------------------^^^^^^^^^^^^^^^
> which is *wrong*. See ^^^^^^^^^^^^^^^ above!
>=20
> With base-files-4.0-4 I get:
>=20
> $ echo $PRINTER
> HP Deskjet 3740 Series
>=20
> which is right.
>=20
> Ciao,
> Angelo.
Thanks for testing.
It looks like it's easier to solve this with a simple if statement.
p=3D'/proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows NT/Current=
Version/Windows/Device'
if [ -e "${p}" ] ; then
read -r PRINTER < "${p}"
PRINTER=3D${PRINTER%%,*}
fi
--=20
Huella de clave primaria: 0FDA C36F F110 54F4 D42B D0EB 617D 396C 448B 31EB
--nVMJ2NtxeReIH9PS
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAk2ClD8ACgkQYX05bESLMeupvQCgw/fvtCi3Qx4cXzOfAAOZNrAs
66wAn1rxvA9iFsVDxSAVAul6X7nmxQC4
=Rg/z
-----END PGP SIGNATURE-----
--nVMJ2NtxeReIH9PS--
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |