[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[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">
|
---|
[e1e58be] | 10 | <!ENTITY which-download-ftp " ">
|
---|
[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 |
|
---|
[880c568] | 21 | <title>Which-&which-version; and Alternatives</title>
|
---|
[cbc6a3b] | 22 |
|
---|
[697e6ca5] | 23 | <para>
|
---|
| 24 | The presence or absence of the <command>which</command> program in the
|
---|
| 25 | main LFS book is probably one of the most contentious issues on the
|
---|
| 26 | mailing lists. It has resulted in at least one flame war in the past. To
|
---|
| 27 | hopefully put an end to this once and for all, presented here are two
|
---|
| 28 | options for equipping your system with <command>which</command>. The
|
---|
| 29 | question of which <quote><command>which</command></quote> is for you to
|
---|
| 30 | decide.
|
---|
| 31 | </para>
|
---|
| 32 |
|
---|
[cbc6a3b] | 33 | <indexterm zone="which">
|
---|
[880c568] | 34 | <primary sortas="a-Which">Which</primary>
|
---|
[cbc6a3b] | 35 | </indexterm>
|
---|
| 36 |
|
---|
[697e6ca5] | 37 | <sect2 role="package">
|
---|
| 38 | <title>Introduction to GNU Which</title>
|
---|
[cbc6a3b] | 39 |
|
---|
[697e6ca5] | 40 | <para>
|
---|
| 41 | The first option is to install the actual GNU
|
---|
| 42 | <application>which</application> package.
|
---|
| 43 | </para>
|
---|
[6b5cc24] | 44 |
|
---|
[09ddf35a] | 45 | &lfs122_checked;
|
---|
[cbc6a3b] | 46 |
|
---|
| 47 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 48 | <itemizedlist spacing="compact">
|
---|
| 49 | <listitem>
|
---|
[b1532549] | 50 | <para>
|
---|
| 51 | Download (HTTP): <ulink url="&which-download-http;"/>
|
---|
| 52 | </para>
|
---|
[cbc6a3b] | 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
[b1532549] | 55 | <para>
|
---|
| 56 | Download (FTP): <ulink url="&which-download-ftp;"/>
|
---|
| 57 | </para>
|
---|
[cbc6a3b] | 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
[b1532549] | 60 | <para>
|
---|
| 61 | Download MD5 sum: &which-md5sum;
|
---|
| 62 | </para>
|
---|
[cbc6a3b] | 63 | </listitem>
|
---|
| 64 | <listitem>
|
---|
[b1532549] | 65 | <para>
|
---|
| 66 | Download size: &which-size;
|
---|
| 67 | </para>
|
---|
[cbc6a3b] | 68 | </listitem>
|
---|
| 69 | <listitem>
|
---|
[b1532549] | 70 | <para>
|
---|
| 71 | Estimated disk space required: &which-buildsize;
|
---|
| 72 | </para>
|
---|
[cbc6a3b] | 73 | </listitem>
|
---|
| 74 | <listitem>
|
---|
[b1532549] | 75 | <para>
|
---|
| 76 | Estimated build time: &which-time;
|
---|
| 77 | </para>
|
---|
[cbc6a3b] | 78 | </listitem>
|
---|
| 79 | </itemizedlist>
|
---|
| 80 |
|
---|
| 81 | </sect2>
|
---|
| 82 |
|
---|
| 83 | <sect2 role="installation">
|
---|
| 84 | <title>Installation of Which</title>
|
---|
| 85 |
|
---|
[b1532549] | 86 | <para>
|
---|
| 87 | Install <application>which</application> by running the following
|
---|
| 88 | commands:
|
---|
| 89 | </para>
|
---|
[cbc6a3b] | 90 |
|
---|
| 91 | <screen><userinput>./configure --prefix=/usr &&
|
---|
| 92 | make</userinput></screen>
|
---|
| 93 |
|
---|
[b1532549] | 94 | <para>
|
---|
| 95 | This package does not come with a test suite.
|
---|
| 96 | </para>
|
---|
[e67834a9] | 97 |
|
---|
[b1532549] | 98 | <para>
|
---|
| 99 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 100 | </para>
|
---|
[cbc6a3b] | 101 |
|
---|
| 102 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
| 103 |
|
---|
| 104 | </sect2>
|
---|
| 105 |
|
---|
| 106 | <sect2 role="content">
|
---|
| 107 | <title>Contents</title>
|
---|
| 108 |
|
---|
| 109 | <segmentedlist>
|
---|
| 110 | <segtitle>Installed Program</segtitle>
|
---|
| 111 | <segtitle>Installed Libraries</segtitle>
|
---|
| 112 | <segtitle>Installed Directories</segtitle>
|
---|
| 113 |
|
---|
| 114 | <seglistitem>
|
---|
| 115 | <seg>which</seg>
|
---|
| 116 | <seg>None</seg>
|
---|
| 117 | <seg>None</seg>
|
---|
| 118 | </seglistitem>
|
---|
| 119 | </segmentedlist>
|
---|
| 120 |
|
---|
| 121 | <variablelist>
|
---|
| 122 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 123 | <?dbfo list-presentation="list"?>
|
---|
| 124 | <?dbhtml list-presentation="table"?>
|
---|
| 125 |
|
---|
| 126 | <varlistentry id="which-prog">
|
---|
| 127 | <term><command>which</command></term>
|
---|
| 128 | <listitem>
|
---|
[b1532549] | 129 | <para>
|
---|
| 130 | shows the full path of (shell) commands installed in your
|
---|
[4c24eb0a] | 131 | <envar>PATH</envar>
|
---|
[b1532549] | 132 | </para>
|
---|
[cbc6a3b] | 133 | <indexterm zone="which which-prog">
|
---|
| 134 | <primary sortas="b-which">which</primary>
|
---|
| 135 | </indexterm>
|
---|
| 136 | </listitem>
|
---|
| 137 | </varlistentry>
|
---|
| 138 |
|
---|
| 139 | </variablelist>
|
---|
| 140 |
|
---|
| 141 | </sect2>
|
---|
| 142 |
|
---|
| 143 | <sect2 role="installation">
|
---|
| 144 | <title>The 'which' Script</title>
|
---|
| 145 |
|
---|
[b1532549] | 146 | <para>
|
---|
| 147 | The second option (for those who don't want to install the package)
|
---|
| 148 | is to create a simple script (execute as the
|
---|
| 149 | <systemitem class="username">root</systemitem> user):
|
---|
| 150 | </para>
|
---|
[cbc6a3b] | 151 |
|
---|
| 152 | <screen role="root"><userinput>cat > /usr/bin/which << "EOF"
|
---|
| 153 | <literal>#!/bin/bash
|
---|
| 154 | type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}</literal>
|
---|
| 155 | EOF
|
---|
| 156 | chmod -v 755 /usr/bin/which
|
---|
| 157 | chown -v root:root /usr/bin/which</userinput></screen>
|
---|
| 158 |
|
---|
[b1532549] | 159 | <para>
|
---|
| 160 | This should work OK and is probably the easiest solution
|
---|
| 161 | for most cases, but is not the most comprehensive implementation.
|
---|
| 162 | </para>
|
---|
[cbc6a3b] | 163 |
|
---|
| 164 | </sect2>
|
---|
[f45b1953] | 165 |
|
---|
| 166 | </sect1>
|
---|