source: general/sysutils/which.xml@ acf7e2c

basic
Last change on this file since acf7e2c was acf7e2c, checked in by Bruce Dubbs <bdubbs@…>, 6 years ago

Updates to Basic BLFS Chapter 3

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/basic@20519 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 4.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY which-download-http "&gnu-http;/which/which-&which-version;.tar.gz">
8 <!ENTITY which-download-ftp "&gnu-ftp;/which/which-&which-version;.tar.gz">
9 <!ENTITY which-md5sum "097ff1a324ae02e0a3b0369f07a7544a">
10 <!ENTITY which-size "148 KB">
11 <!ENTITY which-buildsize "1 MB">
12 <!ENTITY which-time "less than 0.1 SBU">
13]>
14
15<sect1 id="which" xreflabel="Which-&which-version;">
16 <?dbhtml filename="which.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Which-&which-version; and Alternatives</title>
24
25 <para>
26 The presence or absence of the <command>which</command> program in the
27 main LFS book is probably one of the most contentious issues on the
28 mailing lists. It has resulted in at least one flame war in the past. To
29 hopefully put an end to this once and for all, presented here are two
30 options for equipping your system with <command>which</command>. The
31 question of which <quote><command>which</command></quote> is for you to
32 decide.
33 </para>
34
35 <indexterm zone="which">
36 <primary sortas="a-Which">Which</primary>
37 </indexterm>
38
39 <sect2 role="package">
40 <title>Introduction to GNU Which</title>
41
42 <para>
43 The first option is to install the actual GNU
44 <application>which</application> package.
45 </para>
46
47 &lfs83_checked;
48
49 <bridgehead renderas="sect3">Package Information</bridgehead>
50 <itemizedlist spacing="compact">
51 <listitem>
52 <para>Download (HTTP): <ulink url="&which-download-http;"/></para>
53 </listitem>
54 <listitem>
55 <para>Download (FTP): <ulink url="&which-download-ftp;"/></para>
56 </listitem>
57 <listitem>
58 <para>Download MD5 sum: &which-md5sum;</para>
59 </listitem>
60 <listitem>
61 <para>Download size: &which-size;</para>
62 </listitem>
63 <listitem>
64 <para>Estimated disk space required: &which-buildsize;</para>
65 </listitem>
66 <listitem>
67 <para>Estimated build time: &which-time;</para>
68 </listitem>
69 </itemizedlist>
70
71 <para condition="html" role="usernotes">User Notes:
72 <ulink url="&blfs-wiki;/which"/></para>
73
74 </sect2>
75
76 <sect2 role="installation">
77 <title>Installation of Which</title>
78
79 <para>Install <application>which</application> by running the following
80 commands:</para>
81
82<screen><userinput>./configure --prefix=/usr &amp;&amp;
83make</userinput></screen>
84
85 <para>This package does not come with a test suite.</para>
86
87 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
88
89<screen role="root"><userinput>make install</userinput></screen>
90
91 </sect2>
92
93 <sect2 role="content">
94 <title>Contents</title>
95
96 <segmentedlist>
97 <segtitle>Installed Program</segtitle>
98 <segtitle>Installed Libraries</segtitle>
99 <segtitle>Installed Directories</segtitle>
100
101 <seglistitem>
102 <seg>which</seg>
103 <seg>None</seg>
104 <seg>None</seg>
105 </seglistitem>
106 </segmentedlist>
107
108 <variablelist>
109 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
110 <?dbfo list-presentation="list"?>
111 <?dbhtml list-presentation="table"?>
112
113 <varlistentry id="which-prog">
114 <term><command>which</command></term>
115 <listitem>
116 <para>shows the full path of (shell) commands installed in your
117 <envar>PATH</envar>.</para>
118 <indexterm zone="which which-prog">
119 <primary sortas="b-which">which</primary>
120 </indexterm>
121 </listitem>
122 </varlistentry>
123
124 </variablelist>
125
126 </sect2>
127
128 <sect2 role="installation">
129 <title>The 'which' Script</title>
130
131 <para>The second option (for those who don't want to install the package)
132 is to create a simple script (execute as the
133 <systemitem class="username">root</systemitem> user):</para>
134
135<screen role="root"><userinput>cat &gt; /usr/bin/which &lt;&lt; "EOF"
136<literal>#!/bin/bash
137type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}</literal>
138EOF
139chmod -v 755 /usr/bin/which
140chown -v root:root /usr/bin/which</userinput></screen>
141
142 <para>This should work OK and is probably the easiest solution
143 for most cases, but is not the most comprehensive implementation.</para>
144
145 </sect2>
146
147</sect1>
Note: See TracBrowser for help on using the repository browser.