execline-ptrc-extras/where

14 lines
207 B
Plaintext
Executable file

#!/bin/execlineb
elgetpositionals
importas -isd ":" path PATH
backtick -E result {
forx -E -x 0 dir { $path }
if { s6-test -x ${dir}/$1 }
echo ${dir}/$1
}
if { s6-test -n "$result" }
echo "$result"