Skip to content

Instantly share code, notes, and snippets.

@leptos-null
Last active September 21, 2018 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leptos-null/b13a16520ebbc47311dbfa8acced6cc1 to your computer and use it in GitHub Desktop.
Save leptos-null/b13a16520ebbc47311dbfa8acced6cc1 to your computer and use it in GitHub Desktop.
List which: zsh function to print full information about a command
function lw() {
for ARG in "$@"
do
WHICH_RESULT=$(which "$ARG") && {
[[ -e "$WHICH_RESULT" ]] && {
l "$WHICH_RESULT"
continue
}
}
echo "$WHICH_RESULT"
done
}
@leptos-null
Copy link
Author

leptos-null commented Sep 16, 2018

$ lw gst take hash mkdir fake
gst: aliased to git status
take () {
	mkdir -p $@ && cd ${@:$#}
}
hash: shell built-in command
-rwxr-xr-x  1 root  wheel    18K Sep  8 01:21 /bin/mkdir
fake not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment