Created
December 31, 2011 00:32
-
-
Save davidvanvickle/1542205 to your computer and use it in GitHub Desktop.
shell - read xml value
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
if [ -e "yfollowers" ] | |
then | |
NAMES=`cat yfollowers` | |
for value in $NAMES | |
do | |
if [[ $value =~ \<screen_name\>([0-9a-zA-Z_]*)\<\/screen_name\> ]];then | |
i=1 | |
n=${#BASH_REMATCH[*]} | |
while [[ $i -lt $n ]] | |
do | |
u=${BASH_REMATCH[$i]} | |
echo $u | |
echo $u >> tmp | |
let i++ | |
break | |
done | |
shift | |
fi | |
done | |
rm yfollowers | |
if [ -e "followers" ] | |
then | |
rm followers | |
fi | |
sort tmp | uniq > followers | |
rm tmp | |
else | |
echo "no followers" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment