comparison update.sh @ 160:a84b40bc2a99

Add parselist.pl utility and use it in update script.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Aug 2015 22:02:22 +0300
parents e97705171c3c
children b4a07ea2d739
comparison
equal deleted inserted replaced
159:66f3f02d5172 160:a84b40bc2a99
13 CLASSFILE="$2" 13 CLASSFILE="$2"
14 LISTFILE="$2.tmp" 14 LISTFILE="$2.tmp"
15 PATPREFIX="$3" 15 PATPREFIX="$3"
16 16
17 if wget -q -O "$LISTFILE" "$URLPREFIX"; then 17 if wget -q -O "$LISTFILE" "$URLPREFIX"; then
18 perl -ne "if (/<a href=\"${PATPREFIX}([A-Z]{3}\d\S+)${URLSUFFIX}\">/) { print \"\$1\n\"; }" < "$LISTFILE" > "$CLASSFILE" 18 perl -w ./parselist.pl "$PATPREFIX" "$URLSUFFIX" < "$LISTFILE" > "$CLASSFILE"
19 rm -f "$LISTFILE" 19 rm -f "$LISTFILE"
20 echo -n "* Fetched classfile $CLASSFILE: " 20 echo -n "* Fetched classfile $CLASSFILE: "
21 cat "$CLASSFILE" | wc -l 21 cat "$CLASSFILE" | wc -l
22 fi 22 fi
23 } 23 }