Created
August 2, 2020 20:13
-
-
Save obfusk/3caa8c38829895dfdbe3a8b6625e7004 to your computer and use it in GitHub Desktop.
quick command line string equality test
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
| #!/bin/bash | |
| set -e | |
| a="$1" b="$2" | |
| if [ $# -lt 1 ]; then read -r -p "A: " && a="$REPLY"; fi | |
| if [ $# -lt 2 ]; then read -r -p "B: " && b="$REPLY"; fi | |
| test "$a" = "$b" && echo OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment