[52d29f7] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[52d29f7] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[53c525a] | 7 | <!-- <!ENTITY which-download-http "http://www.xs4all.nl/~carlo17/which/which-&which-version;.tar.gz">-->
|
---|
| 8 |
|
---|
[8dfc5c3] | 9 | <!ENTITY which-download-http "&gnu-http;/which/which-&which-version;.tar.gz">
|
---|
| 10 | <!ENTITY which-download-ftp "&gnu-ftp;/which/which-&which-version;.tar.gz">
|
---|
[ff56d2f] | 11 | <!ENTITY which-md5sum "097ff1a324ae02e0a3b0369f07a7544a">
|
---|
| 12 | <!ENTITY which-size "148 KB">
|
---|
[f600251d] | 13 | <!ENTITY which-buildsize "1 MB">
|
---|
[b4054a8] | 14 | <!ENTITY which-time "less than 0.1 SBU">
|
---|
[52d29f7] | 15 | ]>
|
---|
| 16 |
|
---|
[880c568] | 17 | <sect1 id="which" xreflabel="Which-&which-version;">
|
---|
[cbc6a3b] | 18 | <?dbhtml filename="which.html"?>
|
---|
| 19 |
|
---|
| 20 | <sect1info>
|
---|
| 21 | <othername>$LastChangedBy$</othername>
|
---|
| 22 | <date>$Date$</date>
|
---|
| 23 | </sect1info>
|
---|
| 24 |
|
---|
[880c568] | 25 | <title>Which-&which-version; and Alternatives</title>
|
---|
[cbc6a3b] | 26 |
|
---|
[697e6ca5] | 27 | <para>
|
---|
| 28 | The presence or absence of the <command>which</command> program in the
|
---|
| 29 | main LFS book is probably one of the most contentious issues on the
|
---|
| 30 | mailing lists. It has resulted in at least one flame war in the past. To
|
---|
| 31 | hopefully put an end to this once and for all, presented here are two
|
---|
| 32 | options for equipping your system with <command>which</command>. The
|
---|
| 33 | question of which <quote><command>which</command></quote> is for you to
|
---|
| 34 | decide.
|
---|
| 35 | </para>
|
---|
| 36 |
|
---|
[cbc6a3b] | 37 | <indexterm zone="which">
|
---|
[880c568] | 38 | <primary sortas="a-Which">Which</primary>
|
---|
[cbc6a3b] | 39 | </indexterm>
|
---|
| 40 |
|
---|
[697e6ca5] | 41 | <sect2 role="package">
|
---|
| 42 | <title>Introduction to GNU Which</title>
|
---|
[cbc6a3b] | 43 |
|
---|
[697e6ca5] | 44 | <para>
|
---|
| 45 | The first option is to install the actual GNU
|
---|
| 46 | <application>which</application> package.
|
---|
| 47 | </para>
|
---|
[6b5cc24] | 48 |
|
---|
[cdd5a33b] | 49 | &lfs83_checked;
|
---|
[cbc6a3b] | 50 |
|
---|
| 51 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 52 | <itemizedlist spacing="compact">
|
---|
| 53 | <listitem>
|
---|
| 54 | <para>Download (HTTP): <ulink url="&which-download-http;"/></para>
|
---|
| 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
| 57 | <para>Download (FTP): <ulink url="&which-download-ftp;"/></para>
|
---|
| 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
| 60 | <para>Download MD5 sum: &which-md5sum;</para>
|
---|
| 61 | </listitem>
|
---|
| 62 | <listitem>
|
---|
| 63 | <para>Download size: &which-size;</para>
|
---|
| 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
| 66 | <para>Estimated disk space required: &which-buildsize;</para>
|
---|
| 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
| 69 | <para>Estimated build time: &which-time;</para>
|
---|
| 70 | </listitem>
|
---|
| 71 | </itemizedlist>
|
---|
| 72 |
|
---|
[1039de3] | 73 | <para condition="html" role="usernotes">User Notes:
|
---|
| 74 | <ulink url="&blfs-wiki;/which"/></para>
|
---|
| 75 |
|
---|
[cbc6a3b] | 76 | </sect2>
|
---|
| 77 |
|
---|
| 78 | <sect2 role="installation">
|
---|
| 79 | <title>Installation of Which</title>
|
---|
| 80 |
|
---|
| 81 | <para>Install <application>which</application> by running the following
|
---|
| 82 | commands:</para>
|
---|
| 83 |
|
---|
| 84 | <screen><userinput>./configure --prefix=/usr &&
|
---|
| 85 | make</userinput></screen>
|
---|
| 86 |
|
---|
[e67834a9] | 87 | <para>This package does not come with a test suite.</para>
|
---|
| 88 |
|
---|
[cbc6a3b] | 89 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 90 |
|
---|
| 91 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 92 |
|
---|
| 93 | </sect2>
|
---|
| 94 |
|
---|
| 95 | <sect2 role="content">
|
---|
| 96 | <title>Contents</title>
|
---|
| 97 |
|
---|
| 98 | <segmentedlist>
|
---|
| 99 | <segtitle>Installed Program</segtitle>
|
---|
| 100 | <segtitle>Installed Libraries</segtitle>
|
---|
| 101 | <segtitle>Installed Directories</segtitle>
|
---|
| 102 |
|
---|
| 103 | <seglistitem>
|
---|
| 104 | <seg>which</seg>
|
---|
| 105 | <seg>None</seg>
|
---|
| 106 | <seg>None</seg>
|
---|
| 107 | </seglistitem>
|
---|
| 108 | </segmentedlist>
|
---|
| 109 |
|
---|
| 110 | <variablelist>
|
---|
| 111 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 112 | <?dbfo list-presentation="list"?>
|
---|
| 113 | <?dbhtml list-presentation="table"?>
|
---|
| 114 |
|
---|
| 115 | <varlistentry id="which-prog">
|
---|
| 116 | <term><command>which</command></term>
|
---|
| 117 | <listitem>
|
---|
[539ace5] | 118 | <para>shows the full path of (shell) commands installed in your
|
---|
[cbc6a3b] | 119 | <envar>PATH</envar>.</para>
|
---|
| 120 | <indexterm zone="which which-prog">
|
---|
| 121 | <primary sortas="b-which">which</primary>
|
---|
| 122 | </indexterm>
|
---|
| 123 | </listitem>
|
---|
| 124 | </varlistentry>
|
---|
| 125 |
|
---|
| 126 | </variablelist>
|
---|
| 127 |
|
---|
| 128 | </sect2>
|
---|
| 129 |
|
---|
| 130 | <sect2 role="installation">
|
---|
| 131 | <title>The 'which' Script</title>
|
---|
| 132 |
|
---|
[b4054a8] | 133 | <para>The second option (for those who don't want to install the package)
|
---|
[539ace5] | 134 | is to create a simple script (execute as the
|
---|
[cbc6a3b] | 135 | <systemitem class="username">root</systemitem> user):</para>
|
---|
| 136 |
|
---|
| 137 | <screen role="root"><userinput>cat > /usr/bin/which << "EOF"
|
---|
| 138 | <literal>#!/bin/bash
|
---|
| 139 | type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}</literal>
|
---|
| 140 | EOF
|
---|
| 141 | chmod -v 755 /usr/bin/which
|
---|
| 142 | chown -v root:root /usr/bin/which</userinput></screen>
|
---|
| 143 |
|
---|
| 144 | <para>This should work OK and is probably the easiest solution
|
---|
| 145 | for most cases, but is not the most comprehensive implementation.</para>
|
---|
| 146 |
|
---|
| 147 | </sect2>
|
---|
[f45b1953] | 148 |
|
---|
| 149 | </sect1>
|
---|