Tim Post dijo [Sat, Nov 22, 2008 at 05:26:58PM +0800]:
> Hi Gunnar,
>
> I should have noted:
>
> > Is the -n switch to echo now considered safe?
>
> As opposed to printf "%s\t" "$foo", which exists in all modern shells
> including dash, which is fully POSIX compliant and the default sh
> interpreter on many.
Ok, I was not aware of this issue - I'm fixing it for our next
upload. I have removed all the bashisms I was aware of, and of course,
I do share this portability goal you mention. Change committed.
> Yes, its nit picking :) Also, the LSB app checker (which I love) will
> flag warnings if you define your own functions as work-arounds if the
> standard LSB init scripts are not present. So something like:
>
> . /lib/lsb/.. || {
> foo() {
> ...
> ...
> }
> }
>
> ... might be better. While this will raise flags in the app checker, it
> guarantees a working script on appliances which are often sparse and not
> LSB compliant.
Well, in my specific case, I'll leave as it is, as I can trust
/lib/lsb/init-functions to be present in every Debian-based system (it
is in the required lsb-base package). Of course, if you want to
enhance the script and conditionally provide those functions, I won't
object!
> Likewise, telling zsh to emulate sh will also raise a flag. However, we
> have no idea what /bin/sh actually points to on a user's machine and we
> want the script to work :) If they have an agreeable compiler, it should
> 'just work' :) While we hope 'sh' is the POSIX compliant invocation of
> the shell, its not always the case.
Again, I have the benefit of simplification. I can _know_ that /bin/sh
points to a POSIX shell. Of course, /bin/sh is (with us) a symlink, so
FWIW an administrator could point it to whatever he wants... But I can
just trust it to be a POSIX shell.
> Its better to have one that works everywhere, no?
I strongly agree with you. However, unless you give me an example not
taken out of a dizzy administrator doing things backwards, I think we
can keep some assumptions in place ;-)
Greetings,
--
Gunnar Wolf - [EMAIL PROTECTED] - (+52-55)5623-0154 / 1451-2244
PGP key 1024D/8BB527AF 2001-10-23
Fingerprint: 0C79 D2D1 2C4E 9CE4 5973 F800 D80E F35A 8BB5 27AF
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee