e.g. Get http://mirror01.idc.hinet.net/CentOS/ first 7.x dir name
RE=">(7[0-9\.]+)"
[[ `curl -s http://mirror01.idc.hinet.net/CentOS/` =~ $RE ]]
echo ${BASH_REMATCH[1]}
Output:
7.0.1406
e.g. Get http://mirror01.idc.hinet.net/CentOS/ first 7.x dir name
RE=">(7[0-9\.]+)"
[[ `curl -s http://mirror01.idc.hinet.net/CentOS/` =~ $RE ]]
echo ${BASH_REMATCH[1]}
Output:
7.0.1406
This page is an archive of entries in the Shell category from September 2017.
Shell: February 2017 is the previous archive.
Shell: November 2017 is the next archive.
Find recent content on the main index or look in the archives to find all content.
Recent Comments