Created
January 11, 2024 22:41
-
-
Save tynanbe/f9f056e5591ca391ce2fd093cb145adc to your computer and use it in GitHub Desktop.
The quiet type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Quietly queries how each name would be interpreted if used as a command name | |
# | |
# Usage: qtype ...<name> | |
# | |
# Description: | |
# Exits successfully when every name is found. | |
# | |
set -eu | |
case "${#}" in | |
"0") exit 1 ;; | |
*) type "${@}" >/dev/null 2>&1 ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment