Browse Source

Add whichcmd

master
Pekka Helenius 3 years ago
parent
commit
bd85ecc0a6
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      tools/whichcmd.sh

+ 15
- 0
tools/whichcmd.sh View File

@ -0,0 +1,15 @@
#!/bin/env sh
if [[ ${1} == "-h" ]] || [[ ${1} == "--help" ]] || [[ -z ${1} ]]; then
echo "
Find available commands in PATH by input syntax.
Usage: $(basename $0) <command syntax>
"
exit 0
fi
PATHS=($(echo "${PATH}" | sed 's/:/ /g') )
for p in ${PATHS[@]}; do
find "${p}" -iname "*${1}*"
done

Loading…
Cancel
Save