Skip to content

Instantly share code, notes, and snippets.

@codearmorygists
Created September 19, 2012 23:16
Show Gist options
  • Save codearmorygists/3752971 to your computer and use it in GitHub Desktop.
Save codearmorygists/3752971 to your computer and use it in GitHub Desktop.
Check for substring in shell script
string='My string';
if [[ $string == *My* ]]; then
echo "It's there!";
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment