On Mon, Aug 24, 2020 at 12:53 AM ToddAndMargo via users users@lists.fedoraproject.org wrote:
On 2020-08-23 02:19, Tom H wrote:
If you're worried about not finding a command, set "PATH=..." after the shebang.
I could use that with /usr/sbin. Sweet. Thank you!
You're welcome.
Exact path helps where things have the same names too:
/etc/alternatives/ifup /usr/sbin/ifup /usr/share/bash-completion/completions/ifup /var/lib/alternatives/ifup
?!
You only need "/usr/sbin" in PATH to use "ifup".
You definitely don't need any "completions" in a script.
The way that alternatives work is that imagine if Fedora offered ksh93, mksh, and oksh as different versions of ksh and that they were set up via the alternatives mechanism.
There'd be "/bin/{ksh,ksh93,mksh,oksh}" with "/bin/ksh" being a symlink to "/etc/alternatives/ksh" and "/etc/alternatives/ksh" being a symlink to whichever ksh version you wanted to use as ksh.