[BusyBox] "which" issue

Brian T btuch at usa.net
Tue Nov 30 20:20:03 UTC 2004


Seems like a problem with the "which" applet looking in the current running
directoy, and then stopping if it finds a match.  I have a directory called
"cron" in the /root/ directory on an embedded unit.

[root at testhost root]# which which
/usr/bin/which
[root at testhost root]# ls -al /usr/bin/which
lrwxrwxrwx    1 root     root           17 Nov 19 11:13 /usr/bin/which ->
../../bin/busybox
[root at testhost root]# ls -al
drwx------    3 root     root            0 Nov 30 14:01 .
drwxr-xr-x   15 root     root            0 Dec 31  1969 ..
-rw-------    1 root     root         4301 Nov 30 13:29 .bash_history
-rw-r--r--    1 root     root           15 Nov 19 11:13 .bashrc
-rw-r--r--    1 root     root          478 Nov 19 11:13 .profile
-rwxr-xr-x    1 root     root       416332 Nov 19 14:58 busybox
drwxr-xr-x    3 root     root            0 Nov 19 11:13 cron
-rwxr-xr-x    1 root     root           94 Nov 19 14:38 keepalive
-rw-r--r--    1 root     root        90019 Nov 22 09:31 messages
-rwxr-xr-x    1 root     root           48 Nov 30 14:14 test
[root at testhost root]# which cron
cron
[root at testhost root]# find / -name cron
/bin/cron
/var/cron
/root/cron
[root at testhost root]# cd ..
[root at testhost /]# which cron
/bin/cron
[root at testhost /]#
[root at testhost /]# echo $PATH
/usr/sbin:/bin:/usr/bin:/sbin

-Brian






More information about the busybox mailing list