Script help
Posted: 25 Apr 2017, 06:30
How do I access lines in a text file one at a time?
I'm trying to have a script that displays the current Firefox ESR version number. And at this point I have:
which displays a list of 4 or 5 ESR entries. The only entry I am interested in is the last one and the things I've tried only display the 1st one.
I'm trying to have a script that displays the current Firefox ESR version number. And at this point I have:
Code: Select all
#!/bin/sh
FIREFOX=https://download-installer.cdn.mozilla.net/pub/firefox/releases/
ARCH=i386
if [ `echo $MACHTYPE | sed -e 's/-.*$//'` = x86_64 ]; then
ARCH=x86_64
fi
if [ -d "/tmp/ffreleases" ]; then
rm /tmp/ffreleases/index*
rm /tmp/rels5s
fi
#set -x
wget $FIREFOX -P /tmp/ffreleases > /dev/null 2>&1
cat /tmp/ffreleases/index.html | grep "releases/5" > /tmp/rels5s
cat /tmp/rels5s | grep "esr/" > /tmp/esrs
cat /tmp/esrs
Code: Select all
ESRS=$(cat /tmp/esrs)
echo $ESRS
read td href <<< $ESRS
echo $href