#!/bin/sh #Greetingz to calmar@ #awk Freenode i=0; next_link="http://en.wikipedia.org/w/index.php?title=Special:Allpages&from=%22Mr._Technical%22_Barry_Horowitz" lynx -dump $next_link > temp_dump.txt ./awk.sh temp_dump.txt | cut --delimiter=] -f 2 >> file let "i += 1" echo "Successfully downloaded and saved $i Wikipedia Page articles. The link to the next page is:" next_link=`awk '/ 9./' temp_dump.txt | cut --delimiter=. -f 2- ` echo $next_link while [ "&1" != 0 ] do lynx -dump $next_link > temp_dump.txt ./awk.sh temp_dump.txt | cut --delimiter=] -f 2 >> file let "i += 1" echo "Successfully downloaded and saved $i Wikipedia Page articles. The link to the next page is:" next_link=`awk '/ 9./' temp_dump.txt | cut --delimiter=. -f 2-` echo $next_link done #!/bin/bash awk ' /[[[:digit:]]]/ { printf(""); fields = split($0, arr, /\[/); for (i=2; i <= fields; i++ ) { sub(/\].*$/, "", arr[i]); if (int(arr[i]) > 9 && int(arr[i]) < 970 ){ print; break; } } } ' $*