3 ms·
> It isn't just POSIX library calls; it's also the shell and standard utilities and files that are in known locations and standard capabilities and various othe
by kazinator 4y ago
> It isn't just POSIX library calls; it's also the shell and standard utilities and files that are in known locations and standard capabilities and various other things.
POSIX has standardized the shell and utilities since before 1990. Of course, not all of them. As far as locations go, you have to rely on PATH; systems do not agree on what exactly is in /bin, /usr/bin and /sbin.
> A 'Unix' without a useful $HOME environment variable and /tmp may be specification compliant (I haven't checked POSIX) but it's not useful, in that many programs that people want generally won't run on it.
Hits for the HOME variable in POSIX:
https://pubs.opengroup.org/cgi/susv4search.cgi?KEYWORDS=HOME&SUBSTRING=substring&CONTEXT= https://pubs.opengroup.org/cgi/susv4search.cgi?KEYWORDS=HOME...
Under the Shell Command Language it is documented that HOME is "[t]he pathname of the user's home directory. The contents of HOME are used in tilde expansion (see Tilde Expansion)."
/tmp is a de facto standard. POSIX encourages applications to check for the existence of a variable called TMPDIR, but doesn't require implementations to provide that.
There are functions which abstract creating a temporary file or directory. Some of them need a template, some don't. It is possible to write a program which uses /tmp for temporary files, yet doesn't refer to "/tmp".
- knorker 4y agoInteresting that this person would write a post about how much is supposedly not in POSIX, but at the same time saying "I haven't checked POSIX". Rings of "did you know that 'gullible' is not in the dictionary? It's true, look for yourself!".