Re: REQ: Test /etc/rc clean-up
On Fri, 20 Aug 1999 11:59:05 MST, Doug wrote: However I'd REALLY like to emphasize again that if we're going to do this the proper fix is to use case wherever possible. I have offered several times to do the work if it has a chance of being committed, that offer is still good. Hi Doug, The several times before, did folks come up with objections, or was it just a case of mass apathy? :-) I don't want to piss into the wind of wisdom from ages past, but I like the sound of what you're suggesting. I guess if there _are_ sensible objections, they'll crop up when you send a diff? Oh, and thanks for the offer. You no doubt understand that this is probably not something that'll get pumped straight into CURRENT without a goodly number of "works for me" messages in prviate mail from folks using lotsa weird setups. ;-) Ciao, Sheldon. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: REQ: Test /etc/rc clean-up
In message [EMAIL PROTECTED] Sheldon Hearn writes: : -if [ X$start_vinum = XYES ]; then : +if [ X"${start_vinum}" = X"YES" ]; then I never understood why you check against X"YES"? XYES always seemed much better than X"YES" since the latter is somewhat obscure. Both are identical... Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: REQ: Test /etc/rc clean-up
However I'd REALLY like to emphasize again that if we're going to do this the proper fix is to use case wherever possible. There are numerous reasons for this, not the least of which are making the variable case insensitive (and therefore more user friendly) I have to really agree with Doug here. I've seen people use "foo=yes" (vs. "foo=YES") in their rc.conf. They got frustrated when things didn't work. And in IMHO for a no good reason. I have offered several times to do the work if it has a chance of being committed, that offer is still good. What do you think Sheldon? -- -- David([EMAIL PROTECTED] -or- [EMAIL PROTECTED]) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: REQ: Test /etc/rc clean-up
I understand that folks use X$foo becuase if $foo evaluates to -whatever then there is a *chance* that test will misunderstand. I gather the reason for using the X trick *and* the quotes is because there might be some whitespace in there, too. Given that "case" is a builtin and using "case" instead of "test" is both faster, easier to read (less clutter), and supports mixed-case easier, I prefer "case". But I went down this road before. H To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: REQ: Test /etc/rc clean-up
I gather the reason for using the X trick *and* the quotes is because there might be some whitespace in there, too. Actually, that's mostly just historical legacy. When the quotes, it's safe even if the expansion is empty or contains whitespace. I got kinda annoyed with this last night and did the following: http://www.freebsd.org/~jkh/etc.diffs.fix-it-right Which I've sent to Sheldon for review but haven't heard anything back from him yet. - Jordan To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: REQ: Test /etc/rc clean-up
"Jordan K. Hubbard" wrote: I gather the reason for using the X trick *and* the quotes is because there might be some whitespace in there, too. Actually, that's mostly just historical legacy. When the quotes, it's safe even if the expansion is empty or contains whitespace. The X also protected test from the case where the expansion included a string like "-x", although with most modern implementations of test (or shells with test as a builtin) this is no longer a problem. I got kinda annoyed with this last night and did the following: I agree with some of your changes here, but can you explain your objection to using case? My argument is that case is a builtin so it makes things just a little bit cleaner, and more importantly it makes case insensitivity for the options that much easier to implement which is a huge win in user friendliness. For example, what happens to if [ "${pccard_ifconfig}" != "NO" ] if the user makes the flag "no"? I'd say that the fact that this is going to go off anyway violates POLA, all "stupid user" arguments aside. Doug To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message