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