* Gary V. Vaughan wrote on Tue, Feb 07, 2006 at 02:06:54PM CET: > Ralf Wildenhues wrote: > > > > I have come to prefer more minimal quoting in examples, in order to make > > above difference a bit more explicit: it took me a long time to grasp > > this peculiarity of shell syntax. > > You have grasped it?! I still have to resort to typing at the prompt > to figure out what I need in some cases.
It's the bonus of stuff like http://article.gmane.org/gmane.comp.gnu.libtool.patches/4614 ;-) I do trial and error, of course, but when I think I have the right thing I try to verify that it really does what I mean. > One other thing that comes to mind (and the main reason for this reply), > is that there is a good argument that the following is never entirely > safe: > > test "$w00t" -ne 0 > > because it doesn't allow for dangerous expansions of "$w00t" to, say, > `-x'. Well, in fear of contradicting myself, but: if you definitely _know_ that $w00t expands to a number, then you can be sure that this is safe. If not, then you have a point; although shells misparsing above are getting few and far between. > So we really ought to using: > > test x"$w00t" != "x0" > > and so perhaps we should add a TODO item to perform that fix throughout > libtool's shell code, and fixup HACKING to note this idio{m,sycracy}? Not really, IMVHO. The few instances that use `-ne' seem pretty safe to me. For the rest there are tests in sh.test, which will guide you to use test "X$w00t" != "X0" instead. ;-) Cheers, Ralf
