view src/which.sh @ 21955:3991a6df522e v8.2.1527

patch 8.2.1527: Vim9: cannot use a function name at script level Commit: https://github.com/vim/vim/commit/601e76ac3c8fa5d65ac04647a762792ea343ebd5 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 27 21:33:10 2020 +0200 patch 8.2.1527: Vim9: cannot use a function name at script level Problem: Vim9: cannot use a function name as a function reference at script level. Solution: Check if a name is a function name. (closes #6789)
author Bram Moolenaar <Bram@vim.org>
date Thu, 27 Aug 2020 21:45:04 +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