source: general/sysutils/which.xml@ ff769b8c

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.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 ff769b8c was ff769b8c, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Updated the XML sources to use DocBook XML DTD-4.4.

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

  • Property mode set to 100644
File size: 3.8 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 "0.03 SBU">
13]>
14
15<sect1 id="which" xreflabel="which-&which-version;">
16<sect1info>
17<othername>$LastChangedBy$</othername>
18<date>$Date$</date>
19</sect1info>
20<?dbhtml filename="which.html"?>
21<title><application>which</application>-&which-version; and alternatives</title>
22<indexterm zone="which">
23<primary sortas="a-Which">Which</primary></indexterm>
24
25<para>The presence or absence of the <command>which</command> program in the
26main <acronym>LFS</acronym> book is probably one of the most contentious
27issues on the mailing lists. It has resulted in at least one flame war in the
28past. To hopefully put an end to this once and for all, presented here are two
29options for equipping your system with <command>which</command>. The question
30of which <quote><command>which</command></quote> is for you to decide.</para>
31
32<para>The first option is to install the actual <acronym>GNU</acronym> program
33<emphasis>which</emphasis>.</para>
34
35<sect2>
36<title>Introduction to <application>which</application></title>
37
38<sect3><title>Package information</title>
39<itemizedlist spacing='compact'>
40<listitem><para>Download (HTTP): <ulink
41url="&which-download-http;"/></para></listitem>
42<listitem><para>Download (FTP): <ulink
43url="&which-download-ftp;"/></para></listitem>
44<listitem><para>Download MD5 sum: &which-md5sum;</para></listitem>
45<listitem><para>Download size: &which-size;</para></listitem>
46<listitem><para>Estimated disk space required:
47&which-buildsize;</para></listitem>
48<listitem><para>Estimated build time:
49&which-time;</para></listitem></itemizedlist>
50</sect3>
51
52</sect2>
53
54<sect2>
55<title>Installation of <application>which</application></title>
56
57<para>Install <application>which</application> by running the following
58commands:</para>
59
60<screen><userinput><command>./configure --prefix=/usr &amp;&amp;
61make</command></userinput></screen>
62
63<para>Now, as the root user:</para>
64
65<screen><userinput role='root'><command>make install</command></userinput></screen>
66
67</sect2>
68
69<sect2>
70<title>Contents</title>
71
72<segmentedlist>
73<segtitle>Installed Program</segtitle>
74<segtitle>Installed Libraries</segtitle>
75<segtitle>Installed Directories</segtitle>
76
77<seglistitem>
78<seg>which</seg>
79<seg>None</seg>
80<seg>None</seg>
81</seglistitem>
82</segmentedlist>
83
84<variablelist>
85<bridgehead renderas="sect3">Short Descriptions</bridgehead>
86<?dbfo list-presentation="list"?>
87
88<varlistentry id="which-prog">
89<term><command>which</command></term>
90<listitem><para>shows the full path of (shell) commands installed in your
91<envar>PATH</envar>.</para>
92<indexterm zone="which which-prog">
93<primary sortas="b-which">which</primary>
94</indexterm></listitem>
95</varlistentry>
96</variablelist>
97
98</sect2>
99
100<sect2>
101<title>The 'which' script</title>
102<para>The second option (for those who don't want to install the program)
103is to create a simple script (execute as the root user):</para>
104
105<screen><userinput role='root'><command>cat &gt; /usr/bin/which &lt;&lt; "EOF"</command>
106#!/bin/bash
107type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
108<command>EOF
109chmod 755 /usr/bin/which
110chown root:root /usr/bin/which</command></userinput></screen>
111
112<para>This should work OK and is probably the easiest solution
113for most cases, but is not the most comprehensive implementation.</para>
114</sect2>
115
116</sect1>
117
Note: See TracBrowser for help on using the repository browser.