I have come across a couple of instances (copies of each other) of a
non-portable shell "test", but I don't know how to proceed. Help!
Both "heartbeat/lib/BasicSanityCheck.in" and "heartbeat/shellfuncs.in"
contain functionality to make temporary files. These contain the line
test ! -O "$F" -o -L "$F" -o ! -f "$F"
(where $F is a filename).
The problem is that "-O $F" clause. The "-O" (asks: "is the file's owner
the e-uid?") simply isn't available on some OSes (e.g. Solaris). It gives
an error: "test: unknown operator" (and subsequent problems).
What is a good fix? The test, if available, is certainly useful, so I
don't want to remove it. But doing "ls ... $F | cut ..." feels clunky, as
does a possible use of "find ...". Advice welcome!
Lesser priority (don't let it distract from the main point above):
1. I'm also a little concerned that "-L" (symlink test) might not be as
portable as we might like. (This hasn't bitten me yet.)
2. Do we need this "maketempfile() {}" in two separate places? Could BSC
be re-jigged to use "heartbeat/shellfuncs.in"?
--
: David Lee I.T. Service :
: Senior Systems Programmer Computer Centre :
: Durham University :
: http://www.dur.ac.uk/t.d.lee/ South Road :
: Durham DH1 3LE :
: Phone: +44 191 334 2752 U.K. :
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/