LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 983|回复: 7

lfs的which 命令是在那个包安装的?

[复制链接]
发表于 2007-1-16 20:40:03 | 显示全部楼层 |阅读模式
lfs的which 命令是在那个包安装的?

今天安装gnome-panel竟然说bash: which: command not found
发表于 2007-1-16 21:02:40 | 显示全部楼层
gentoo ~ # equery b which
[ Searching for file(s) which in *... ]
sys-apps/which-2.16 (/usr/bin/which)

http://www.xs4all.nl/~carlo17/which/
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-1-17 10:34:11 | 显示全部楼层
ok,thanks
回复 支持 反对

使用道具 举报

发表于 2007-1-18 08:36:49 | 显示全部楼层
一个简单的脚本就可以搞定了,这个在blfs的手册里有说明。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-1-18 08:49:06 | 显示全部楼层
Post by seasonhu
一个简单的脚本就可以搞定了,这个在blfs的手册里有说明。


简单的脚本?是什么脚本阿?可否说的详细一点,谢谢
回复 支持 反对

使用道具 举报

发表于 2007-1-18 10:06:41 | 显示全部楼层
blfs上的说明
Which-2.16 and Alternatives

The presence or absence of the which program in the main LFS book is probably one of the most contentious issues on the mailing lists. It has resulted in at least one flame war in the past. To hopefully put an end to this once and for all, presented here are two options for equipping your system with which. The question of which “which” is for you to decide.

The first option is to install the actual GNU which package.
Introduction to Which
Package Information

    *

      Download (HTTP): http://www.xs4all.nl/~carlo17/which/which-2.16.tar.gz
    *

      Download (FTP): ftp://ftp.gnu.org/gnu/which/which-2.16.tar.gz
    *

      Download MD5 sum: 830b83af48347a9a3520f561e47cbc9b
    *

      Download size: 123 KB
    *

      Estimated disk space required: 940 KB
    *

      Estimated build time: less than 0.1 SBU

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/which
Installation of Which

Install which by running the following commands:

./configure --prefix=/usr &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Contents
Installed Program: which
Installed Libraries: None
Installed Directories: None
Short Descriptions
which        

shows the full path of (shell) commands installed in your PATH.
The 'which' Script

The second option (for those who don't want to install the package) is to create a simple script (execute as the root user):

cat > /usr/bin/which << "EOF"
#!/bin/bash
type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
EOF
chmod -v 755 /usr/bin/which
chown -v root:root /usr/bin/which

This should work OK and is probably the easiest solution for most cases, but is not the most comprehensive implementation.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-1-18 10:27:40 | 显示全部楼层
原来那个脚本是第二种方法阿,刚才没仔细看以为是第二个步骤拉,现在已经都用上了
回复 支持 反对

使用道具 举报

发表于 2007-1-19 17:50:57 | 显示全部楼层
which是一个单独的包,在BLFS里有
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表