nvchecker: refactor pipes in scripts
This commit is contained in:
parent
e849548ec5
commit
aa9aef7ca2
2 changed files with 14 additions and 8 deletions
|
@ -22,6 +22,12 @@ UPSTREAM_URL="ftp://ftp.sendmail.org/pub/sendmail/"
|
|||
USER_AGENT="sendmail-version-checker/1.0 george@rawlinson.net.nz"
|
||||
CURL_OPTS=(--ftp-pasv --silent --user-agent "$USER_AGENT")
|
||||
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" | tr -s ' ' | cut -d ' ' -f 9 | grep -E "sendmail\..+\.tar\.gz\.sig$" | sed -e 's/^sendmail\.//' -e 's/\.tar\.gz\.sig$//' | sort -n | tail -n 1
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" | \
|
||||
tr -s ' ' | \
|
||||
cut -d ' ' -f 9 | \
|
||||
grep -E "sendmail\..+\.tar\.gz\.sig$" | \
|
||||
sed -e 's/^sendmail\.//' -e 's/\.tar\.gz\.sig$//' | \
|
||||
sort -n | \
|
||||
tail -n 1
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -22,13 +22,13 @@ UPSTREAM_URL="ftp://ftp.gnu.org/gnu/time/"
|
|||
USER_AGENT="time-version-checker/1.0 george@rawlinson.net.nz"
|
||||
CURL_OPTS=(--ftp-pasv --silent --user-agent "$USER_AGENT")
|
||||
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" \
|
||||
| tr -s ' ' \
|
||||
| cut -d ' ' -f 9 \
|
||||
| grep ".tar.gz$" \
|
||||
| sort -n \
|
||||
| tail -n 1 \
|
||||
| sed -e "s/^time-//" -e "s/.tar.gz$//"
|
||||
curl "${CURL_OPTS[@]}" "$UPSTREAM_URL" | \
|
||||
tr -s ' ' | \
|
||||
cut -d ' ' -f 9 | \
|
||||
grep ".tar.gz$" | \
|
||||
sort -n | \
|
||||
tail -n 1 | \
|
||||
sed -e "s/^time-//" -e "s/.tar.gz$//"
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue