dotfiles/.local/bin/wh

5 lines
138 B
Bash
Executable File

#!/bin/sh
# like "which", but shows contents if it resolves to a file
res=$(which "$@")
test -r "$res" && b --plain "$res" || echo "$res"