Open sarcasticadmin opened 4 years ago
The problem is the -p
flag:
If the -p option is specified, the command search is performed
using a default value of PATH that is guaranteed to find all of
the standard utilities.
It ignores user's PATH and substitutes _PATH_STDPATH
, which is /usr/bin : /bin : /usr/sbin : /sbin
.
I don't think that makes much sense for mons
and would suggest simply dropping the -p
.
@cemeyer Thanks for the clarification, thats makes sense since xrandr
is under /usr/local/bin
in FreeBSD.
Regardless, I think it still makes some sense cover both cases and check _PATH_STDPATH
if for whatever reason the user was to botch their PATH
.
Sure, it seems harmless to me.
hello, any update..?
Description
Depends on: https://github.com/Ventto/libshlist/pull/2 Closes: #30
It does not seem that "command -pv xrandr" is able to find xrandr in my PATH on FreeBSD. Im not sure if this is due to there just not being a default /etc/environment set or what but I think we should be checking the current PATH as well as the default to make sure we search all possibilities.
Let me know what you think.
Tests
Building with my PR from libshlist: https://github.com/Ventto/libshlist/pull/2 nets me the expect results: