view src/which.sh @ 20075:516b10943fdb v8.2.0593

patch 8.2.0593: finding a user command is not optimal Commit: https://github.com/vim/vim/commit/a494f56f885876c98a276f7acfa386bfbb344680 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 18 17:45:38 2020 +0200 patch 8.2.0593: finding a user command is not optimal Problem: Finding a user command is not optimal. Solution: Start further down in the list of commands.
author Bram Moolenaar <Bram@vim.org>
date Sat, 18 Apr 2020 18:00:03 +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