source: general/sysutils/which.xml@ 9c90b1b

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 9c90b1b was 22ac237, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Typo fix. General.

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