Skip to content

Instantly share code, notes, and snippets.

@bartlett705
Created September 29, 2018 09:10
Show Gist options
  • Save bartlett705/e92aa689fdb8d483bb68ec241d1f71da to your computer and use it in GitHub Desktop.
Save bartlett705/e92aa689fdb8d483bb68ec241d1f71da to your computer and use it in GitHub Desktop.
diff 2 strings on the command line
#!/bin/bash
# shamelessley ripped from stack overflow
# compares two string args with 'success' message if they match exactly
string1=$1
string2=$2
[ "$string1" == "$string2" ] || { echo "⛔ dong due et ⛔" && false; } && echo "👍 good stuff 👍"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment