Hi all,
I'm currently constructing a solution out of steel and steam. Will report
back with plans shortly.
On Friday, February 28, 2014, Volker Kuhlmann
On Fri 28 Feb 2014 15:54:56 NZDT +1300, Jim Cheetham wrote:
echo " M T W T F" for i in $(seq 2015 2115) do echo $i Jan $(cal 1 $i |sed -nr 's/^[[:digit:]]+ (([[:digit:]]+ ){5}).*/\1/;t h;b e;:h h;:e $x;$p') done
Oops:
echo " M T W T F" M T W T F for i in $(seq 2015 2018) do echo $i Jan $(/usr/bin/cal 1 $i |sed -nr 's/^[[:digit:]]+ (([[:digit:]]+){5}).*/\1/;t h;b e;:h h;:e $x;$p') done 2015 Jan 2016 Jan 2017 Jan 2018 Jan
Maybe you should have spent 3 days on sed, not 2...? ;-)
The previously posted awk solution didn't work either because 15 years ago I had replaced cal with a cal that was doing a few useful things too, but with the linux-utils one it worked.
Volker
-- Volker Kuhlmann is list0570 with the domain in header. http://volker.top.geek.nz/ Please do not CC list postings to me. _______________________________________________ NZNOG mailing list NZNOG(a)list.waikato.ac.nz javascript:; http://list.waikato.ac.nz/mailman/listinfo/nznog