Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Ian Stakenvicius <axs@g.o>
Subject: Re: RFC: esethome
Date: Fri, 15 Jun 2012 09:35:38 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 15/06/12 09:27 AM, Peter Stuge wrote:
> Mike Frysinger wrote:
>>> +       # lets see if the username already exists +       if [[
>>> ! -n $(egetent passwd "${euser}") ]] ; then
>> 
>> "! -n" -> "-z"
> 
> Does the $() argument ever need to be double quoted, or do all 
> versions of bash actually have the string argument optional even 
> though that's not what the man page reads?
> 
> 
> //Peter


Ever?  Yes, but only if what is being returned can contain spaces (and
this matters in the way that it's used).  In the case of 'egetent
passwd', afaict no as it doesn't return anything with whitespace in it.

Examples -- this works:

$ bubba="test thing" ; if [ -n "$(echo $bubba)" ]; then echo OK; fi
OK

Example -- this fails:

$ bubba="test thing" ; if [ -n $(echo $bubba) ]; then echo OK; fi
bash: [: test: binary operator expected

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iF4EAREIAAYFAk/bOioACgkQ2ugaI38ACPAUegD+JPzG4oX25QcqXYSfp/c2IE5o
aydKUHZonedILskm5UoA/2bnn2PMFh5lm1rXh7H4/2d9MQaghAUlCmMv0/XORQtW
=7fD+
-----END PGP SIGNATURE-----


Replies:
Re: RFC: esethome
-- Peter Stuge
Re: RFC: esethome
-- Fabian Groffen
References:
RFC: enewuser should force updates to shell and home
-- Ian Stakenvicius
Re: RFC: enewuser should force updates to shell and home
-- Mike Frysinger
Re: RFC: esethome
-- Ian Stakenvicius
Re: RFC: esethome
-- Mike Frysinger
Re: RFC: esethome
-- Peter Stuge
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: RFC: esethome
Next by thread:
Re: RFC: esethome
Previous by date:
[PATCH] prune_libtool_files(): go into .a removal only when .a exists.
Next by date:
Re: RFC: esethome


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.