glfs/general/sysutils/which.xml
Randy McMurchy 1586494b11 Spelling, grammar, tag and excessive whitespace corrections to various package instructions
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3134 af4574ff-66df-0310-9fd7-8a98e5e911e0
2004-12-22 01:00:40 +00:00

94 lines
3.0 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY which-download-http "http://www.xs4all.nl/~carlo17/which/which-&which-version;.tar.gz">
<!ENTITY which-download-ftp "ftp://ftp.gnu.org/gnu/which/which-&which-version;.tar.gz">
<!ENTITY which-size "123 KB">
<!ENTITY which-buildsize "940 KB">
<!ENTITY which-time "0.03 SBU">
]>
<sect1 id="which" xreflabel="which-&which-version;">
<sect1info>
<othername>$LastChangedBy$</othername>
<date>$Date$</date>
</sect1info>
<?dbhtml filename="which.html"?>
<title><application>which</application>-&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 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, presented here are two
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>
<sect2>
<title>Introduction to <application>which</application></title>
<sect3><title>Package information</title>
<itemizedlist spacing='compact'>
<listitem><para>Download (HTTP): <ulink
url="&which-download-http;"/></para></listitem>
<listitem><para>Download (FTP): <ulink
url="&which-download-ftp;"/></para></listitem>
<listitem><para>Download size: &which-size;</para></listitem>
<listitem><para>Estimated disk space required:
&which-buildsize;</para></listitem>
<listitem><para>Estimated build time:
&which-time;</para></listitem></itemizedlist>
</sect3>
</sect2>
<sect2>
<title>Installation of <application>which</application></title>
<para>Install <application>which</application> by running the following
commands:</para>
<screen><userinput><command>./configure --prefix=/usr &amp;&amp;
make &amp;&amp;
make install</command></userinput></screen>
</sect2>
<sect2>
<title>Contents</title>
<para>The <application>which</application> package contains
<command>which</command>.</para>
</sect2>
<sect2><title>Description</title>
<sect3><title>which</title>
<para><command>which</command> shows the full path of (shell) commands.</para>
</sect3>
</sect2>
<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 &gt; /usr/bin/which &lt;&lt; "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>