[Nottingham] HOT Dating one-liner contest

Martin Garton martin at stupids.org
Mon Jan 14 17:28:21 GMT 2008


> Now, for interest, any non-perl solutions anyone?

Here's an ugly (and not even really complete) non-perl solution in the
form of a bash script.

#!/bin/bash
for i in $(seq 12)
do
 x=$(cal $i 2008 | cut -c 10-11 | head -3 | tail -1)
 if [ "$x" == "  " ]; then
  x=$(cal $i 2008 | cut -c 10-11 | head -4 | tail -1)
 fi
echo Wed: $x   Thu: $(echo $(($x + 15)))
done

-- 
Martin.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/nottingham/attachments/20080114/6e3ac016/attachment.bin


More information about the Nottingham mailing list