Re:Dwarf Fortress starting during apt-get upgrade
by vbezhenar on Wednesday August 16, 2017 @04:32AM
(#15025860)
Don't trust $PATH in scripts. Use `/bin/df`.
[ Parent
| on HN ]
Re:Dwarf Fortress starting during apt-get upgrade
by iso-8859-1 on Wednesday August 16, 2017 @06:03AM
(#15026256)
But then it's not portable across distros and to BSD's. On FreeBSD, bash is in /usr/local/bin/bash (if it is installed)
Do you also write "if /usr/bin/[ $? != 0 ]; then ..." ?
Re:Dwarf Fortress starting during apt-get upgrade
by lottin on Wednesday August 16, 2017 @06:37AM
(#15026405)
df is a standard utility, like ls or cd. Invoking df on a POSIX system should do the expected thing, and if it doesn't it means something is broken.
Re:Dwarf Fortress starting during apt-get upgrade
by JdeBP on Wednesday August 16, 2017 @07:51AM
(#15026725)
... only if one has used
getconf PATH
to set the path to the one that guarantees that.* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ge...
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/co...
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/uni...
Re:Dwarf Fortress starting during apt-get upgrade
by mnw21cam on Wednesday August 16, 2017 @06:58AM
(#15026492)
On Unix/Linux, there is very little stopping the superuser from introducing new and inventive kinds of breakage, such as in this case. This one is just a little more amusing than most. But seriously, if root wants to install a new command called df and have it higher up in the PATH than the standard utility, why should the OS argue?
Re:Dwarf Fortress starting during apt-get upgrade
by oelmekki on Wednesday August 16, 2017 @07:17AM
(#15026573)
Note that the OS doesn't argue :)
But actually, it would be cool to have some kind of warning, like a POSIX linter that warns the user something broke the standard, and they can decide to ignore it and never hear about it again. I'm not a big fan of linters, usually, but it would make sense for end users tweaking their system.