AWK: read the next line
getline
, the function reads the next line and moves the script to it.
I wanted to get the current git version number from https://git-scm.com/downloads, and using getline
came very handy by running something like this:
curl --silent https://git-scm.com/downloads | awk '/span class="version"/ {getline; print $1}'
I'm able to get the latest version number.