source: general/sysutils/which.xml@ eeaa41b7

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since eeaa41b7 was eeaa41b7, checked in by Douglas R. Reno <renodr@…>, 4 years ago

Some tags, and a fix for the libarchive test suite problem

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@23537 af4574ff-66df-0310-9fd7-8a98e5e911e0

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