#!/bin/bash
rec_fetch() {
echo fetching $1
curl --no-progress-meter https://www.sco.com/developers/gabi/latest/$1 -o $1
# Handle following link tags:
#
#
#
#
#
for page in $(grep href $1 |\
sed 's/.*href="\{0,1\}\([a-zA-Z._0-9]*\)"\{0,1\}[#>].*/\1/g' |\
sort | uniq); do
if [[ -z $page || -f $page || ${page##*.} != html ]]; then
continue;
fi
rec_fetch $page
done
}
rec_fetch contents.html