Skip to content

Instantly share code, notes, and snippets.

View CRThaze's full-sized avatar

Diego Fernando Carrión CRThaze

View GitHub Profile
@CRThaze
CRThaze / whence.sh
Last active August 9, 2024 14:43
`which` is frankly insufficient. Whence fully resolves symlinks, and tells you if a command is something else like a function or built-in.
function whence() {
local print_links=false
local command=""
local batch=false
# Manual option parsing
for arg in "$@"; do
case "$arg" in
-p)
print_links=true