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