Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/var/bin/mksh
- # find all the executables in the path, that match the parameters
- SAVE_IFS="$IFS"
- for X in $@
- do
- IFS="${IFS}:"
- for P in $PATH
- do
- cd "$P" || break;
- if [[ -x "$X" ]];
- then
- print "$P/$X"
- fi
- done
- IFS="$SAVE_IFS"
- done
- #consider storing PATH in an array, becauses of special character issues.
- #consider checking std path like whereis
- #consider allowing wildcard matches,
- #consider reworking to go though path , first... or alternate path
- #consider meh no maybenot NEATOdirectory in arg list
- # when all Im considering is if . is, kinda stupid to miss it.
- #if $P == $P ?
Add Comment
Please, Sign In to add comment