Hi Gary.  Few more random nits...

On Monday 21 November 2011, Gary V wrote:
> To safely use a non-literal first argument to `test', you must
> always prepend a literal non-`-' character, but often the second
> operand is a constant that doesn't begin with a `-' already, so
> always use `test a = "$b"' instead of noisy `test "X$b" = Xa'.
>
This seems "back-bending" to me, and slightly unclear to read.  Also,
it goes against the (unofficial) conventions of autoconf, which is
to use either `test "x$b" = xa' or `test "x$b" = Xa'.

Also ...

>  # Bootstrap this package from checked-out sources.
>  # Written by Gary V. Vaughan, 2010
> @@ -1760,7 +1760,7 @@ func_ifcontains ()
>        ;;
>      esac
> 
> -    test "$_G_status" -eq 0 || exit $_G_status
> +    test 0 -eq $_G_status || exit $_G_status
>  }
... changes like this seems overly paranoid, in case $_G_status is
expected (as I surmise it is) to be a non-negative integer.  And
if this assumption stps to hold dur to a bug in your code, you are
going to be bitten by much worse problem anyway:

 # $shell is either Solaris 1 0or AT&T ksh, Solaris 10 XPG4 sh, or
 # zsh 4.3.12.
 $ $shell -c 'exit t; echo foo'; echo status = $?
 status = 0

Regards,
  Stefano



Reply via email to