From dbd670107b344b14efea67c59d10d2668882d626 Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Tue, 6 Nov 2012 23:35:36 +0100 Subject: [PATCH] bin: script to display a binary clock --- bin/binary_clock | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/binary_clock diff --git a/bin/binary_clock b/bin/binary_clock new file mode 100755 index 0000000..09e0d5d --- /dev/null +++ b/bin/binary_clock @@ -0,0 +1,17 @@ +#!/bin/sh + +for a in $(date +"%H%M%S"|cut -b1,2,3,4,5,6 --output-delimiter=" ") +do + case "$a" in + 0) echo ". . . .";; + 1) echo ". . . *";; + 2) echo ". . * .";; + 3) echo ". . * *";; + 4) echo ". * . .";; + 5) echo ". * . *";; + 6) echo ". * * .";; + 7) echo ". * * *";; + 8) echo "* . . .";; + 9) echo "* . . *";; + esac +done