[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

various minor rc script logic errors

They are purely cosmetic at this point but the rc startup script has cases 
where it doesn't like it when files are missing. A simple case would be NFS.
Somehow I was under the impression that when /bin/sh was running a conditional
with a bunch of AND's it would shortcircuit on the first false. I guess not.

The script says:
if [ X${nfs_server} = X"YES" -a -r /etc/exports -a \ `cat /etc/exports....];

Well /etc/exports doesn't exist yet it's still trying to continue evaluating
the expression. Can we purhaps split the logic into 2 steps?

Also, why do we have scripts that do this X$variable thingy = X"value" whereas
others have IMO the more correct ${variable} = "value" format? Is there a 
problem doing comparisions if one side is an empty string? I'm not a shell
programmer so please excuse my ignorance.

Visit your host, monkey.org