On Fri, 02 May 2003, James Yonan wrote:
> How do most other initialization scripts handle the differences between bash 1
> and 2? Do they just restrict themselves to the least common denominator (a)?
Yes. /bin/sh is standardized; Solaris for some strange reason ship
b0rked year-old stuff though
On Fri, May 02, 2003 at 11:25:46AM +0200, Alberto Gonzalez Iniesta wrote:
> Anyway, I'm attaching Debian's init.d script in case you want to take a
> look at it.
>
Doh! I ALWAYS forget to attach files! Sorry :)
--
Alberto Gonzalez Iniesta | They that give up essential liberty
agi@(agi.a
IMHO init scripts must be POSIX (Bourne?) compliant.
They should work in bash, ksh, whateversh, and don't depend on the
administrator's will to install one or another.
i.e.
I'll say this:
if [ $errors == 1 ]; then
is better this way:
if [ $errors -eq 1 ]; then
And this:
How do most other initialization scripts handle the differences between bash 1
and 2? Do they just restrict themselves to the least common denominator (a)?
Or do they try to explicitly instantiate bash2 (b)?
-#!/bin/sh
+#!/bin/bash2
(b) could be risky if there are distros where where /bin/bash2
James, Folks,
I noticed a minor problem as my RH62 box started up:
$Starting openvpn: /etc/rc.d/init.d/openvpn: [: ==: binary operator expected
That's two distinct, common errors:
- $localization stuff that doesn't work on bash1
- an == in a [] in the script.
These are both directly relate