flexiondotorg/oab-java6 — comment on commit 1f84a69d8e5e24c7dc2765d333e1ef78b3adfe9a
File: oab-java6.sh line 273
By mikkorantalainen:

How about something like this:

JAVA_VER="6"
RELEASE_PAGE_URL=$(wget -qO- "http://www.oracle.com/technetwork/java/javase/downloads/index.html" | perl -ne 'if (m@/technetwork/java/javase/downloads/jdk-6u[0-9]+-download-[0-9]+.html@) { s@.*(/technetwork/java/javase/downloads/jdk-6u[0-9]+-download-[0-9]+.html).*@http://www.oracle.com$1@; print}')
JAVA_UPD=$(wget -qO- "$RELEASE_PAGE_URL" | perl -ne 'if (m@http://download.oracle.com/otn-pub/java/jdk/6u[0-9]+-b[0-9]+/jdk-6u[0-9]+-linux-i586.bin@) { s@.*http://download.oracle.com/otn-pub/java/jdk/6u([0-9]+)-b[0-9]+/jdk-6u[0-9]+-linux-i586.bin.*@$1@; print}')
JAVA_REL=$(wget -qO- "$RELEASE_PAGE_URL" | perl -ne 'if (m@http://download.oracle.com/otn-pub/java/jdk/6u[0-9]+-b[0-9]+/jdk-6u[0-9]+-linux-i586.bin@) { s@.*http://download.oracle.com/otn-pub/java/jdk/6u[0-9]+-(b[0-9]+)/jdk-6u[0-9]+-linux-i586.bin.*@$1@; print}')

(Sorry for the long lines and poor performance because of not using temporary files...)