Changeset 3891001
- Timestamp:
- 02/26/2005 08:59:08 PM (19 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 6.0, 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:
- 38b41c2
- Parents:
- ae7f265
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
general/sysutils/which.xml
rae7f265 r3891001 20 20 <?dbhtml filename="which.html"?> 21 21 <title><application>which</application>-&which-version; and alternatives</title> 22 <indexterm zone="which"> 23 <primary sortas="a-Which">Which</primary></indexterm> 22 24 23 <para>The presence or absence of the which program in the main24 <acronym>LFS</acronym> book is probably one of the most contentious issues on25 the mailing lists. It has resulted in at least one flame war in the past.26 To hopefully put an end to this once and for all, presented here are two27 options for equipping your system with "which". The question of which "which"28 is for you to decide.</para>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> 29 31 30 32 <para>The first option is to install the actual <acronym>GNU</acronym> program … … 57 59 58 60 <screen><userinput><command>./configure --prefix=/usr && 59 make && 60 make install</command></userinput></screen> 61 make</command></userinput></screen> 62 63 <para>Now, as the root user:</para> 64 65 <screen><userinput role='root'><command>make install</command></userinput></screen> 61 66 62 67 </sect2> … … 65 70 <title>Contents</title> 66 71 67 <para>The <application>which</application> package contains 68 <command>which</command>.</para> 72 <segmentedlist> 73 <segtitle>Installed Program</segtitle> 74 <segtitle>Installed Libraries</segtitle> 75 <segtitle>Installed Directories</segtitle> 69 76 70 </sect2> 77 <seglistitem> 78 <seg>which</seg> 79 <seg>None</seg> 80 <seg>None</seg> 81 </seglistitem> 82 </segmentedlist> 71 83 72 <sect2><title>Description</title> 84 <variablelist> 85 <bridgehead renderas="sect3">Short Descriptions</bridgehead> 86 <?dbfo list-presentation="list"?> 73 87 74 <sect3><title>which</title> 75 <para><command>which</command> shows the full path of (shell) commands.</para> 76 </sect3> 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> 77 97 78 98 </sect2> … … 81 101 <title>The 'which' script</title> 82 102 <para>The second option (for those who don't want to install the program) 83 is to create a simple script:</para> 84 <screen><userinput><command>cat > /usr/bin/which << "EOF"</command> 103 is to create a simple script (execute as the root user):</para> 104 105 <screen><userinput role='root'><command>cat > /usr/bin/which << "EOF"</command> 85 106 #!/bin/bash 86 107 type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]} … … 88 109 chmod 755 /usr/bin/which 89 110 chown root:root /usr/bin/which</command></userinput></screen> 111 90 112 <para>This should work OK and is probably the easiest solution 91 113 for most cases, but is not the most comprehensive implementation.</para>
Note:
See TracChangeset
for help on using the changeset viewer.