source: general/sysutils/which.xml@ f8b4f14

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since f8b4f14 was d0c42be, checked in by Douglas R. Reno <renodr@…>, 16 months ago

Initial tags for 11.3

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