execline-ptrc-extras/where

14 lines
207 B
Text
Raw Permalink Normal View History

2022-08-05 17:06:16 +00:00
#!/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"