view src/which.sh @ 10207:9415453b7bbd v8.0.0004

commit https://github.com/vim/vim/commit/5582ef14384525e8cec86016876d97a6b32dd548 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 14 22:16:13 2016 +0200 patch 8.0.0004 Problem: A string argument for function() that is not a function name results in an error message with NULL. (Christian Brabandt) Solution: Use the argument for the error message.
author Christian Brabandt <cb@256bit.org>
date Wed, 14 Sep 2016 22:30:10 +0200
parents 3fc0f57ecb91
children
line wrap: on
line source

#! /bin/sh
#
# which.sh -- find where an executable is located.  It's here because the
# "which" command is not supported everywhere.  Used by Makefile.

IFS=":"
for ac_dir in $PATH; do
	if test -f "$ac_dir/$1"; then
		echo "$ac_dir/$1"
		break
	fi
done