Last active
August 29, 2015 14:10
-
-
Save cmlh/17c534e18199cb5ad675 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
directories=( | |
'dir1' | |
'dir2') | |
function search { | |
res=$(unzip -c \*.mtgx Graphs/Graph1.graphml 2>&1 |egrep "(Archive: )|$1" |grep "<mtg:Value" -B1) | |
res=$(echo -e "$res" |sed 's/\<mtg\:Value\>//g') | |
res=$(echo -e "$res" |sed 's/\<\/mtg\:Value\>//g') | |
echo -e "$res"|grep -v "<" | |
} | |
for dir in "${directories[@]}"; do | |
cd "$dir" && search $1 | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment