source: general/sysutils/which.xml@ 6d27308

systemd-13485
Last change on this file since 6d27308 was 6d27308, checked in by Douglas R. Reno <renodr@…>, 8 years ago

GCC6 Tags

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@17356 af4574ff-66df-0310-9fd7-8a98e5e911e0

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