jhalfs suggestion

M.Canales.es manuel at linuxfromscratch.org
Fri Jan 13 09:42:57 PST 2006

El Jueves, 12 de Enero de 2006 23:36, Bruce Dubbs escribió:
> M.Canales.es wrote:

> >>===>  Insert here  [ -n $BOOK ] && WC=1
> >
> > With that $WC will be always set. Test it and you will see.

I meant that the proper syntax is:

[ -n "$BOOK" ] && WC=1

From http://www.tldp.org/LDP/abs/html/comparison-ops.html

-n    string is not "null".

The -n test absolutely requires that the string be quoted within the test 
brackets. Using an unquoted string with ! -z, or even just the unquoted 
string alone within test brackets (see Example 7-6) normally works, however, 
this is an unsafe practice. Always quote a tested string. 

> Arg.  Try:
> [ -z $BOOK ] || WC=1

That also could work, but I think that the current approach (defining WC in 
jhalfs.conf, committed yesterday),  is safer.

Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfromscratch.org
LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.com
TLDP-ES:                           http://es.tldp.org

More information about the alfs-discuss mailing list