On Wed, Sep 15, 2010 at 2:36 PM, Trevor Woerner wrote: > From: Trevor Woerner <[email protected]> > > - use '-z' or '-n' instead of x"$VAR" > - compare strings to strings and numbers to numbers > - use ${variable:=word} to set default variable values > > Signed-off-by: Trevor Woerner <[email protected]> > --- > build.sh | 65 ++++++++++++++++++++++++++----------------------------------- > 1 files changed, 28 insertions(+), 37 deletions(-) > > diff --git a/build.sh b/build.sh > index fa6a321..20aee43 100755
Reviewed-by: Tormod Volden <[email protected]> On Wed, Sep 15, 2010 at 2:09 PM, Trevor Woerner wrote: > Forcing the type to string using the 'x' works (which is what I assume > to be the purpose of this notation), but so does: BTW, in Bourne shell there is no notion of types, it is all (substituted) strings. But beware of "lack of string" :) For instance, [ -n $a ] returns true and [ -n "$a" ] returns false if a is not set. The "[" function applies after parsing and string substitution, and sees just [ -n ] in the first case. Which it does not handle well IMO. _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
