Created
February 15, 2024 19:46
-
-
Save Qyriad/c40965bc30add5821d2cad41e7e17ced to your computer and use it in GitHub Desktop.
Discount `dbg!()` in Bash
This file contains hidden or 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
| function what() { | |
| echo -n "what $1: " | |
| if declare -p "$1" > /dev/null 2>&1; then | |
| declare -p "$1" | |
| elif declare -F "$1" > /dev/null 2>&1; then | |
| declare -F "$1" | |
| elif type -t "$1" > /dev/null 2>&1; then | |
| type -t "$1" | |
| else | |
| echo "string --" "$1" | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment