Intrepid Ibex
August 24th, 2012, 05:13 PM
So hi.
I wrote this fairly simple script to check the latest version strings of all the 3 Chrome channels:
#!/bin/bash
cd /tmp
curl -sO http://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz
gzip -df other.xml.gz
echo; echo -n "Stable: "
grep '\-stable' other.xml | cut -d " " -f6 | cut -d '"' -f2; echo
echo -n "Beta: "
grep beta other.xml | cut -d " " -f6 | cut -d '"' -f2; echo
echo -n "Unstable: "
grep unstable other.xml | cut -d " " -f6 | cut -d '"' -f2; echo
rm other.xml
Which currently produces:
Stable: 21.0.1180.81
Beta: 22.0.1229.14
Unstable: 23.0.1243.2
My question is: is there a way(s) to simplify this even further (e.g. using awk or a loop for all the three channels or something)?
I wrote this fairly simple script to check the latest version strings of all the 3 Chrome channels:
#!/bin/bash
cd /tmp
curl -sO http://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz
gzip -df other.xml.gz
echo; echo -n "Stable: "
grep '\-stable' other.xml | cut -d " " -f6 | cut -d '"' -f2; echo
echo -n "Beta: "
grep beta other.xml | cut -d " " -f6 | cut -d '"' -f2; echo
echo -n "Unstable: "
grep unstable other.xml | cut -d " " -f6 | cut -d '"' -f2; echo
rm other.xml
Which currently produces:
Stable: 21.0.1180.81
Beta: 22.0.1229.14
Unstable: 23.0.1243.2
My question is: is there a way(s) to simplify this even further (e.g. using awk or a loop for all the three channels or something)?