start-stop daemon

Michael A. Peters mpeters at mac.com
Wed Apr 23 00:04:36 PDT 2003


On Tue, 2003-04-22 at 21:09, Michael A. Peters wrote:
> Yes, it does. A bash function could so so easily be written to do that -
> but the binary will be faster. It is a very common binary for people to
> want to have on their system anyway.

Just for the record - I tried it with a shell function-
scriptwhich()
{
	binary=$1
	for a in `echo $PATH |sed -e s?":"?" "?g`; do
	if [ -x "$a/$binary" ]; then
		echo "$a/$binary"
		exit 0
	fi
	done
	exit 1
}

It was considerably slower. Many times slower. On a XP 2700+
I did fix the binary having to be in the path, though.
If it's specified full path to the function it uses that.

-- 
Michael A. Peters <mpeters at mac.com>

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list