back with another question. it keeps grabbing all the html coding around the string. I can see that its finding the string in the output but its also grabbing the html coding content as well.
Code:
#! /bin/sh
if [ $# -ne 2 ]; then
echo "usage: $0 termfile baseurl" >&2
exit 1
fi
termfile="$1"
baseurl="$2"
while read term; do
wget -q -O- "$baseurl/server.php?all=$term" |
sed 's/^.*terms_id=\([^&]*\)&.*$/\1/'
done < "$termfile"