source: general/sysutils/which.xml@ d40dd18

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 d40dd18 was 8a00ffb8, checked in by Thomas Trepl (Moody) <thomas@…>, 3 years ago

Tags

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