[FRILLS] Get your ChangeLog rococo
by NonNonBa from LinuxQuestions.org on (#4ZRH7)
Hi,
Just sharing a little piece of code, to get a colorized version of the ChangeLog of your Slack (did you know the Greek statues were originally painted?)
Have fun. :hattip:
Code:#!/bin/sh
log=https://mirrors.slackware.com/slackware/slackware
[ "$(uname -m)" = "x86_64" ] && log=${log}64
read a v </etc/slackware-version
if [ "${v%+}" = "$v" ]; then
log=$log-$v
else
log=$log-current
fi
curl -sL $log/ChangeLog.txt | awk '
/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) [A-S].. / {
print "\033[1;7m"$0"\033[0;0m"; next
}
/^[^: ]+\/[^: ]+:/ {
x = tolower($2)
c = "1;34m"
if ((index(x, "added") == 1))
c = "1;32m"
else if ((index(x, "removed") == 1))
c = "1;31m"
$1 = "\033["c$1"\033[0;0m"; print; next
}
/^\+---+/{ $0 = "" }{ print }' | less -sir


Just sharing a little piece of code, to get a colorized version of the ChangeLog of your Slack (did you know the Greek statues were originally painted?)
Have fun. :hattip:
Code:#!/bin/sh
log=https://mirrors.slackware.com/slackware/slackware
[ "$(uname -m)" = "x86_64" ] && log=${log}64
read a v </etc/slackware-version
if [ "${v%+}" = "$v" ]; then
log=$log-$v
else
log=$log-current
fi
curl -sL $log/ChangeLog.txt | awk '
/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) [A-S].. / {
print "\033[1;7m"$0"\033[0;0m"; next
}
/^[^: ]+\/[^: ]+:/ {
x = tolower($2)
c = "1;34m"
if ((index(x, "added") == 1))
c = "1;32m"
else if ((index(x, "removed") == 1))
c = "1;31m"
$1 = "\033["c$1"\033[0;0m"; print; next
}
/^\+---+/{ $0 = "" }{ print }' | less -sir