Messages in this thread | | | From | (Miquel van Smoorenburg) | Subject | Re: 2.2.18pre12 fix for some distros | Date | 30 Sep 2000 18:19:44 +0200 |
| |
In article <E13fNNw-0002Iq-00@the-village.bc.nu>, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: >I'll play with the proposed which based fixes first, unless you have clever >ideas ?
Include a script in scripts/kwhich that tells you the path to a certain binary.
Below is a simple implementation. If you condense it you can even include it in the Makefile verbatim, though a seperate script seems cleaner to me.
% ./kwhich unknowncc gcc272 gcc cc /usr/bin/gcc272
#! /bin/sh
# kwhich 1.0 (C) 2000 Miquel van Smoorenburg # This program is GPLed
if [ $# -lt 1 ] then echo "Usage: $0 cmd [cmd..]" >&2 exit 1 fi
IFS=: for cmd in $* do for path in $PATH do if [ -x "$path/$cmd" ] then echo "$path/$cmd" exit 0 fi done done
echo "$*: not found" >&2 exit 1
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
| |