home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: addw@phcomp.co.uk (Alain Williams)
-
- > >A puzzle for the reader (maybe this is obvious to everyone but
- > >me): How can a shell script determine whether it's running on
- > >a POSIX.2 system? If it calls getconf and getconf does not
- > >exist, the shell may exit. It could call getconf in a
- > >subshell, but that's ugly and expensive.
- >
- > I don't know what POSIX says, but I'd expect an analog to POSIX.1 -
- > an environment variable telling which version of POSIX we are.
- > POSIX.1 does the same with #define.
- Yuck! There is too much in the environment already, and anyway it is far
- too easily changed (accidentally or otherwise).
-
- What is really wanted is something which can be easily put onto systems, both
- new and existing. One of the problems is "OK we invent a way of doing it,
- but there are still many systems out there which won't have it/do it". Have
- you tried writing a portable program in ansi C ? We have to live with the
- old ones for a while.
-
- The old machines had commands like `vax' and `pdp11'. That was never really
- developed/continued (sigh).
-
- OK, use getconf, but what if it doesn't exist. Well, you could use my `path'
- program to find out if it exists. It is a (Bourne) shell script, so portable
- and not very long. I will post it to this list if you think that it would
- be useful. I use it quite a lot for all sorts of things, eg:
- size `path emacs vi`
- and it can be illuminating to try:
- path -a some_command
-
- Alain Williams
- +44 734 461232
- phLOGIN our Turnkey Security Login utility is available NOW - ask me for info.
-
- Volume-Number: Volume 24, Number 61
-
-