source: general/sysutils/which.xml@ 2f85c65

10.0 10.1 11.0 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 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 2f85c65 was 2f85c65, checked in by Christian Wurst <cwurst@…>, 13 years ago

updated to which-2.20

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