just another one of my rumblings
Mike Frysinger
vapier at gentoo.org
Sat Apr 26 02:02:08 UTC 2008
On Thursday 24 April 2008, Cristian Ionescu-Idbohrn wrote:
> `...` and $(...) are posix and equivalent. I find $(...) easier to use
> and cleaner, as nesting is much easier when using $(...). Mixing the two
> in one and the same script easily leads to controversy. Picking on
> testsuite/runtest this time ;-) See for example this line in the named
> script:
>
> [ -n "$bindir" ] || bindir=$(dirname $(pwd))
>
> Can someone provide a backtick equivalent example?
> That could even be simplified to:
>
> ["$bindir" ] || bindir=$(dirname $(pwd))
>
> without loosing anything. The attached patch is attemting to make
> testsuite/runtest more style consistent.
ignoring the lack of whitespace after the first [, you lose clarity.
[ -n "$var" ] is clear. [ "$var" ] is not.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080425/ee5613fe/attachment-0002.pgp
More information about the busybox
mailing list