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">
|
---|
9 | <!ENTITY which-size "123 KB">
|
---|
10 | <!ENTITY which-buildsize "940 KB">
|
---|
11 | <!ENTITY which-time "0.03 SBU">
|
---|
12 | ]>
|
---|
13 |
|
---|
14 | <sect1 id="which" xreflabel="which-&which-version;">
|
---|
15 | <sect1info>
|
---|
16 | <othername>$LastChangedBy$</othername>
|
---|
17 | <date>$Date$</date>
|
---|
18 | </sect1info>
|
---|
19 | <?dbhtml filename="which.html"?>
|
---|
20 | <title>which-&which-version; and alternatives</title>
|
---|
21 |
|
---|
22 | <para>The presence or absence of the which program in the main <acronym>LFS
|
---|
23 | </acronym> book is probably one of the most contentious issues we have on the
|
---|
24 | mailing lists. It has resulted in at least one flame war in the past.
|
---|
25 | To hopefully put an end to this once and for all, we here present two of
|
---|
26 | the options for equipping your system with "which". The question of which "which"
|
---|
27 | is for you to decide.</para>
|
---|
28 |
|
---|
29 | <para>The first option is to install the actual <acronym>GNU</acronym> program
|
---|
30 | <emphasis>which</emphasis>.</para>
|
---|
31 |
|
---|
32 | <sect2>
|
---|
33 | <title>Introduction to <application>which</application></title>
|
---|
34 |
|
---|
35 | <sect3><title>Package information</title>
|
---|
36 | <itemizedlist spacing='compact'>
|
---|
37 | <listitem><para>Download (HTTP): <ulink
|
---|
38 | url="&which-download-http;"/></para></listitem>
|
---|
39 | <listitem><para>Download (FTP): <ulink
|
---|
40 | url="&which-download-ftp;"/></para></listitem>
|
---|
41 | <listitem><para>Download size: &which-size;</para></listitem>
|
---|
42 | <listitem><para>Estimated Disk space required:
|
---|
43 | &which-buildsize;</para></listitem>
|
---|
44 | <listitem><para>Estimated build time:
|
---|
45 | &which-time;</para></listitem></itemizedlist>
|
---|
46 | </sect3>
|
---|
47 |
|
---|
48 |
|
---|
49 | </sect2>
|
---|
50 |
|
---|
51 | <sect2>
|
---|
52 | <title>Installation of <application>which</application></title>
|
---|
53 |
|
---|
54 | <para>Install <application>which</application> by running the following
|
---|
55 | commands:</para>
|
---|
56 |
|
---|
57 | <screen><userinput><command>./configure --prefix=/usr &&
|
---|
58 | make &&
|
---|
59 | make install</command></userinput></screen>
|
---|
60 |
|
---|
61 | </sect2>
|
---|
62 |
|
---|
63 |
|
---|
64 | <sect2>
|
---|
65 | <title>Contents</title>
|
---|
66 |
|
---|
67 | <para>The <application>which</application> package contains <command>which</command>.</para>
|
---|
68 |
|
---|
69 | </sect2>
|
---|
70 |
|
---|
71 | <sect2><title>Description</title>
|
---|
72 |
|
---|
73 | <sect3><title>which</title>
|
---|
74 | <para><command>which</command> shows the full path of (shell) commands.</para>
|
---|
75 | </sect3>
|
---|
76 |
|
---|
77 | </sect2>
|
---|
78 |
|
---|
79 | <sect2>
|
---|
80 | <title>The 'which' script</title>
|
---|
81 | <para>The second option (for those who don't want to install the program)
|
---|
82 | is to create a simple script:</para>
|
---|
83 | <screen><userinput><command>cat > /usr/bin/which << "EOF"</command>
|
---|
84 | #!/bin/bash
|
---|
85 | type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
|
---|
86 | <command>EOF
|
---|
87 | chmod 755 /usr/bin/which
|
---|
88 | chown root:root /usr/bin/which</command></userinput></screen>
|
---|
89 | <para>This should work OK and is probably the easiest solution
|
---|
90 | for most cases, but is not the most comprehensive implementation.</para>
|
---|
91 | </sect2>
|
---|
92 |
|
---|
93 | </sect1>
|
---|
94 |
|
---|