helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
806 stars 58 forks source link

Allow for rcorder to be invoked without parameters #308

Closed probonopd closed 2 years ago

probonopd commented 2 years ago

Keep typing rcorder /etc/rc.d/* /usr/local/share/etc/rc.d/* all the time to see the order in which rc scripts will be run.

Unfortunately rcorder without any arguments doesn't do the sensible thing. It just does nothing.

Can we make it work?

#!/bin/sh
if [ "$#" == 0 ] ; then
  /sbin/rcorder /etc/rc.d/* /usr/local/share/etc/rc.d/*
else
  /sbin/rcorder "$@"
fi

This does not work because the order in

% echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin

is such that /sbin always wins...

Is there another good way to achieve this? Ideas?

probonopd commented 2 years ago

I have put it in as the rcordered command until we find a solution. Same question goes for /usr/bin/man:

#!/bin/sh
launch Falkon "https://www.freebsd.org/cgi/man.cgi?${1}"

Isn't it backwards that in FreeBSD, system commands win over local commands?

probonopd commented 2 years ago

How much breakage would we cause by changing the default $PATH from

/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin

to

$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/games:/usr/sbin:/usr/bin:/sbin:/bin

which means that the "more local" directories win over the "more upstream" ones?