Changeset cbc6a3b
- Timestamp:
- 05/07/2005 11:05:53 AM (19 years ago)
- Branches:
- 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
- Children:
- d0006cd8
- Parents:
- c88ffaa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
general/sysutils/which.xml
rc88ffaa rcbc6a3b 14 14 15 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> 16 <?dbhtml filename="which.html"?> 24 17 25 <para>The presence or absence of the <command>which</command> program in the 26 main <acronym>LFS</acronym> book is probably one of the most contentious 27 issues on the mailing lists. It has resulted in at least one flame war in the 28 past. To hopefully put an end to this once and for all, presented here are two 29 options for equipping your system with <command>which</command>. The question 30 of which <quote><command>which</command></quote> is for you to decide.</para> 18 <sect1info> 19 <othername>$LastChangedBy$</othername> 20 <date>$Date$</date> 21 </sect1info> 31 22 32 <para>The first option is to install the actual <acronym>GNU</acronym> program 33 <emphasis>which</emphasis>.</para> 23 <title>Which-&which-version; and Alternatives</title> 34 24 35 <sect2> 36 <title>Introduction to <application>which</application></title> 25 <indexterm zone="which"> 26 <primary sortas="a-Which">Which</primary> 27 </indexterm> 37 28 38 <sect3><title>Package information</title> 39 <itemizedlist spacing='compact'> 40 <listitem><para>Download (HTTP): <ulink 41 url="&which-download-http;"/></para></listitem> 42 <listitem><para>Download (FTP): <ulink 43 url="&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> 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> 51 35 52 </sect2> 36 <para>The first option is to install the actual GNU program 37 <application>which</application>.</para> 53 38 54 <sect2>55 <title>Installation of <application>which</application></title>39 <sect2 role="package"> 40 <title>Introduction to Which</title> 56 41 57 <para>Install <application>which</application> by running the following 58 commands:</para> 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> 59 63 60 <screen><userinput><command>./configure --prefix=/usr && 61 make</command></userinput></screen> 64 </sect2> 62 65 63 <para>Now, as the root user:</para> 66 <sect2 role="installation"> 67 <title>Installation of Which</title> 64 68 65 <screen><userinput role='root'><command>make install</command></userinput></screen> 69 <para>Install <application>which</application> by running the following 70 commands:</para> 66 71 67 </sect2> 72 <screen><userinput>./configure --prefix=/usr && 73 make</userinput></screen> 68 74 69 <sect2> 70 <title>Contents</title> 75 <para>Now, as the <systemitem class="username">root</systemitem> user:</para> 71 76 72 <segmentedlist> 73 <segtitle>Installed Program</segtitle> 74 <segtitle>Installed Libraries</segtitle> 75 <segtitle>Installed Directories</segtitle> 77 <screen role="root"><userinput>make install</userinput></screen> 76 78 77 <seglistitem> 78 <seg>which</seg> 79 <seg>None</seg> 80 <seg>None</seg> 81 </seglistitem> 82 </segmentedlist> 79 </sect2> 83 80 84 <variablelist> 85 <bridgehead renderas="sect3">Short Descriptions</bridgehead> 86 <?dbfo list-presentation="list"?> 81 <sect2 role="content"> 82 <title>Contents</title> 87 83 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> 84 <segmentedlist> 85 <segtitle>Installed Program</segtitle> 86 <segtitle>Installed Libraries</segtitle> 87 <segtitle>Installed Directories</segtitle> 97 88 98 </sect2> 89 <seglistitem> 90 <seg>which</seg> 91 <seg>None</seg> 92 <seg>None</seg> 93 </seglistitem> 94 </segmentedlist> 99 95 100 <sect2>101 <title>The 'which' script</title>102 <para>The second option (for those who don't want to install the program) 103 is to create a simple script (execute as the root user):</para>96 <variablelist> 97 <bridgehead renderas="sect3">Short Descriptions</bridgehead> 98 <?dbfo list-presentation="list"?> 99 <?dbhtml list-presentation="table"?> 104 100 105 <screen><userinput role='root'><command>cat > /usr/bin/which << "EOF"</command> 106 #!/bin/bash 107 type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]} 108 <command>EOF 109 chmod 755 /usr/bin/which 110 chown root:root /usr/bin/which</command></userinput></screen> 101 <varlistentry id="which-prog"> 102 <term><command>which</command></term> 103 <listitem> 104 <para>shows the full path of (shell) commands installed in your 105 <envar>PATH</envar>.</para> 106 <indexterm zone="which which-prog"> 107 <primary sortas="b-which">which</primary> 108 </indexterm> 109 </listitem> 110 </varlistentry> 111 111 112 <para>This should work OK and is probably the easiest solution 113 for most cases, but is not the most comprehensive implementation.</para> 114 </sect2> 112 </variablelist> 113 114 </sect2> 115 116 <sect2 role="installation"> 117 <title>The 'which' Script</title> 118 119 <para>The second option (for those who don't want to install the program) 120 is to create a simple script (execute as the 121 <systemitem class="username">root</systemitem> user):</para> 122 123 <screen role="root"><userinput>cat > /usr/bin/which << "EOF" 124 <literal>#!/bin/bash 125 type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}</literal> 126 EOF 127 chmod -v 755 /usr/bin/which 128 chown -v root:root /usr/bin/which</userinput></screen> 129 130 <para>This should work OK and is probably the easiest solution 131 for most cases, but is not the most comprehensive implementation.</para> 132 133 </sect2> 115 134 116 135 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.