[52d29f7] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
| 7 | <!ENTITY which-download-http "http://www.xs4all.nl/~carlo17/which/which-&which-version;.tar.gz">
|
---|
| 8 | <!ENTITY which-download-ftp "ftp://ftp.gnu.org/gnu/which/which-&which-version;.tar.gz">
|
---|
[a31d341d] | 9 | <!ENTITY which-md5sum "830b83af48347a9a3520f561e47cbc9b">
|
---|
[52d29f7] | 10 | <!ENTITY which-size "123 KB">
|
---|
| 11 | <!ENTITY which-buildsize "940 KB">
|
---|
| 12 | <!ENTITY which-time "0.03 SBU">
|
---|
| 13 | ]>
|
---|
| 14 |
|
---|
[f45b1953] | 15 | <sect1 id="which" xreflabel="which-&which-version;">
|
---|
[a0f03b0] | 16 | <sect1info>
|
---|
[5cd0959d] | 17 | <othername>$LastChangedBy$</othername>
|
---|
| 18 | <date>$Date$</date>
|
---|
[a0f03b0] | 19 | </sect1info>
|
---|
[7f72cbf] | 20 | <?dbhtml filename="which.html"?>
|
---|
[1586494] | 21 | <title><application>which</application>-&which-version; and alternatives</title>
|
---|
[f45b1953] | 22 |
|
---|
[1586494] | 23 | <para>The presence or absence of the which program in the main
|
---|
| 24 | <acronym>LFS</acronym> book is probably one of the most contentious issues on
|
---|
| 25 | the mailing lists. It has resulted in at least one flame war in the past.
|
---|
| 26 | To hopefully put an end to this once and for all, presented here are two
|
---|
| 27 | options for equipping your system with "which". The question of which "which"
|
---|
[2ab68bb] | 28 | is for you to decide.</para>
|
---|
[f45b1953] | 29 |
|
---|
[46bca118] | 30 | <para>The first option is to install the actual <acronym>GNU</acronym> program
|
---|
[85ef7049] | 31 | <emphasis>which</emphasis>.</para>
|
---|
| 32 |
|
---|
[52d29f7] | 33 | <sect2>
|
---|
| 34 | <title>Introduction to <application>which</application></title>
|
---|
[1586494] | 35 |
|
---|
[52d29f7] | 36 | <sect3><title>Package information</title>
|
---|
| 37 | <itemizedlist spacing='compact'>
|
---|
| 38 | <listitem><para>Download (HTTP): <ulink
|
---|
| 39 | url="&which-download-http;"/></para></listitem>
|
---|
| 40 | <listitem><para>Download (FTP): <ulink
|
---|
| 41 | url="&which-download-ftp;"/></para></listitem>
|
---|
[a31d341d] | 42 | <listitem><para>Download MD5 sum: &which-md5sum;</para></listitem>
|
---|
[52d29f7] | 43 | <listitem><para>Download size: &which-size;</para></listitem>
|
---|
[1586494] | 44 | <listitem><para>Estimated disk space required:
|
---|
[52d29f7] | 45 | &which-buildsize;</para></listitem>
|
---|
| 46 | <listitem><para>Estimated build time:
|
---|
| 47 | &which-time;</para></listitem></itemizedlist>
|
---|
| 48 | </sect3>
|
---|
[1586494] | 49 |
|
---|
[52d29f7] | 50 | </sect2>
|
---|
| 51 |
|
---|
| 52 | <sect2>
|
---|
| 53 | <title>Installation of <application>which</application></title>
|
---|
[1586494] | 54 |
|
---|
[52d29f7] | 55 | <para>Install <application>which</application> by running the following
|
---|
| 56 | commands:</para>
|
---|
[1586494] | 57 |
|
---|
[52d29f7] | 58 | <screen><userinput><command>./configure --prefix=/usr &&
|
---|
| 59 | make &&
|
---|
| 60 | make install</command></userinput></screen>
|
---|
| 61 |
|
---|
[1586494] | 62 | </sect2>
|
---|
[52d29f7] | 63 |
|
---|
| 64 | <sect2>
|
---|
| 65 | <title>Contents</title>
|
---|
[1586494] | 66 |
|
---|
| 67 | <para>The <application>which</application> package contains
|
---|
| 68 | <command>which</command>.</para>
|
---|
| 69 |
|
---|
[52d29f7] | 70 | </sect2>
|
---|
[1586494] | 71 |
|
---|
[52d29f7] | 72 | <sect2><title>Description</title>
|
---|
[1586494] | 73 |
|
---|
[52d29f7] | 74 | <sect3><title>which</title>
|
---|
| 75 | <para><command>which</command> shows the full path of (shell) commands.</para>
|
---|
| 76 | </sect3>
|
---|
[1586494] | 77 |
|
---|
[52d29f7] | 78 | </sect2>
|
---|
[f45b1953] | 79 |
|
---|
[52d29f7] | 80 | <sect2>
|
---|
| 81 | <title>The 'which' script</title>
|
---|
[85ef7049] | 82 | <para>The second option (for those who don't want to install the program)
|
---|
| 83 | is to create a simple script:</para>
|
---|
[110ec35a] | 84 | <screen><userinput><command>cat > /usr/bin/which << "EOF"</command>
|
---|
[f45b1953] | 85 | #!/bin/bash
|
---|
[2687739] | 86 | type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
|
---|
[110ec35a] | 87 | <command>EOF
|
---|
[f45b1953] | 88 | chmod 755 /usr/bin/which
|
---|
[110ec35a] | 89 | chown root:root /usr/bin/which</command></userinput></screen>
|
---|
[70b65ddf] | 90 | <para>This should work OK and is probably the easiest solution
|
---|
| 91 | for most cases, but is not the most comprehensive implementation.</para>
|
---|
[85ef7049] | 92 | </sect2>
|
---|
[f45b1953] | 93 |
|
---|
| 94 | </sect1>
|
---|
| 95 |
|
---|