view src/which.sh @ 26230:8b8470b511f5 v8.2.3646

patch 8.2.3646: using <sfile> in a function gives an unexpected result Commit: https://github.com/vim/vim/commit/c449271f4efa44725c40116a95b213813040312f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 22 15:37:15 2021 +0000 patch 8.2.3646: using <sfile> in a function gives an unexpected result Problem: Using <sfile> in a function gives an unexpected result. Solution: Give an error in a Vim9 function. (issue https://github.com/vim/vim/issues/9189)
author Bram Moolenaar <Bram@vim.org>
date Mon, 22 Nov 2021 16:45:04 +0100
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