[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
various minor rc script logic errors
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: various minor rc script logic errors
- From: "Matthew E. Patton" <pattonme_(_at_)_gnpr_(_dot_)_pae_(_dot_)_osd_(_dot_)_mil>
- Date: Fri, 27 Feb 1998 14:47:16 -0500 (EST)
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