First versions of the binaries and source file.
This commit is contained in:
parent
d2630d6e4f
commit
1dfda10ddc
11 changed files with 742 additions and 0 deletions
29
what
Executable file
29
what
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
# 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
|
||||
#
|
||||
|
||||
PWD=/
|
||||
ALL_BINS=$(cd / && echo $PATH | sed 's/[:]/ /g' | xargs ls -A | grep -v ":" | sort | uniq)
|
||||
OUTPUT=$(printf '%s\n' "-n" $ALL_BINS | grep -i "$1")
|
||||
echo "$OUTPUT"
|
||||
Loading…
Add table
Add a link
Reference in a new issue