2002-07-08 04:28:42 +08:00
|
|
|
<sect1 id="which" xreflabel="which-&which-version;">
|
|
|
|
<?dbhtml filename="which.html" dir="general"?>
|
2002-08-05 03:08:14 +08:00
|
|
|
<title>which-&which-version; and alternatives</title>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
|
|
|
<para>The presence / absence of the which program in the main LFS 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 recent past.
|
2003-02-26 08:43:40 +08:00
|
|
|
To hopefully put an end to this once and for all, we here present two of
|
|
|
|
the options for equipping your system with "which".</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2003-02-26 08:43:40 +08:00
|
|
|
<para>The first option is to install the actual GNU program
|
|
|
|
<emphasis>which</emphasis>.</para>
|
|
|
|
|
|
|
|
&which-intro;
|
|
|
|
&which-inst;
|
|
|
|
&which-desc;
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2003-02-26 08:43:40 +08:00
|
|
|
<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>
|
2002-07-19 07:38:11 +08:00
|
|
|
<para><screen><userinput>cat > /usr/bin/which << "EOF"</userinput>
|
2002-07-08 04:28:42 +08:00
|
|
|
#!/bin/bash
|
|
|
|
type -p "$@"
|
|
|
|
<userinput>EOF
|
|
|
|
chmod 755 /usr/bin/which
|
2002-07-14 03:15:38 +08:00
|
|
|
chown root:root /usr/bin/which</userinput></screen></para>
|
2002-07-08 04:28:42 +08:00
|
|
|
<para>This should generally work OK and is probably the easiest solution
|
|
|
|
for boxes which don't need a good user environment to work in.</para>
|
2003-02-26 08:43:40 +08:00
|
|
|
</sect2>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|