mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-26 08:42:12 +08:00
70b65ddffb
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@2246 af4574ff-66df-0310-9fd7-8a98e5e911e0
34 lines
1.2 KiB
XML
34 lines
1.2 KiB
XML
<sect1 id="which" xreflabel="which-&which-version;">
|
|
<?dbhtml filename="which.html"?>
|
|
<title>which-&which-version; and alternatives</title>
|
|
|
|
<para>The presence or absence of the which program in the main <acronym>LFS
|
|
</acronym> book is probably one of the most contentious issues we have on the
|
|
mailing lists. It has resulted in at least one flame war in the past.
|
|
To hopefully put an end to this once and for all, we here present two of
|
|
the options for equipping your system with "which". The question of which "which"
|
|
is for you to decide.</para>
|
|
|
|
<para>The first option is to install the actual <acronym>GNU</acronym> program
|
|
<emphasis>which</emphasis>.</para>
|
|
|
|
&which-intro;
|
|
&which-inst;
|
|
&which-desc;
|
|
|
|
<sect2><title>The 'which' script</title>
|
|
<para>The second option (for those who don't want to install the program)
|
|
is to create a simple script:</para>
|
|
<screen><userinput><command>cat > /usr/bin/which << "EOF"</command>
|
|
#!/bin/bash
|
|
type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
|
|
<command>EOF
|
|
chmod 755 /usr/bin/which
|
|
chown root:root /usr/bin/which</command></userinput></screen>
|
|
<para>This should work OK and is probably the easiest solution
|
|
for most cases, but is not the most comprehensive implementation.</para>
|
|
</sect2>
|
|
|
|
</sect1>
|
|
|