lackadaisical/what
Sam Hardeman ab730db2f7 Major chhanges: daisy.source renamed to ld.source.
All files have been prettified by making sure we use 2-space indent.

agenda:
Instead of the hidden .tree file, a file created "More..." is made.
You can use (ex) "agenda --view "2026" to get a full list of files from that
year/date/day.
Additionally, minor fixes have been made.

clip:
You can now use "-c" to clear the clipbaord.
2026-05-05 15:42:34 +02:00

35 lines
605 B
Bash
Executable file

#!/usr/bin/env bash
# Where is the binary?
# Usage: what [<keyword>]
# Returns:
# With no parameters, all visible binaries in PATH.
# With parameter, all binaries that match the pattern
# given. Accepts default grep patterns, case insensitive
#
# Examples:
# $ what zs.*
# pzstd
# zsh
# zstd
#
# $ what ftp
# ftppass
# sftp
# vsftpd
#
# $ what ftp | xargs which
# /usr/bin/ftppass
# /usr/bin/sftp
# /usr/sbin/vsftpd
#
LD_INTERNAL=1
. $(dirname $(realpath $0))/ld.source
all_bins=$(compgen -c | sort -u)
if [[ -n "$1" ]]; then
echo "$all_bins" | grep -i "$1"
else
echo "$all_bins"
fi