Created
November 18, 2011 00:02
-
-
Save zackdouglas/1375040 to your computer and use it in GitHub Desktop.
BASH variable regexp
This file contains 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/bash | |
FOO='the scarecow walks at midnight' | |
if [ 'the scarecrow walks at midnight' = ${FOO/scarecow/scarecrow/} ] ; then | |
echo 'your shell supports regex on variable retrieval' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment