Last active
September 15, 2023 22:38
-
-
Save fhuitelec/f900ba41fc6ed55199b2fff4dd226d4d to your computer and use it in GitHub Desktop.
[Check if array is empty] #zsh #shell #cheatsheet
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
#!/usr/bin/env zsh | |
# | |
# Check if array is empty | |
# | |
typeset -A knock_sequences | |
if [ ${#knock_sequences[@]} -eq 0 ]; then | |
echo "No knock sequence found." | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment