summaryrefslogtreecommitdiffstats
path: root/modules/zeit
diff options
context:
space:
mode:
authorroot <root@shack.(none)>2010-05-05 00:04:01 +0200
committerroot <root@shack.(none)>2010-05-05 00:04:01 +0200
commitbe718edd485e9f8ae8fb6e239f6a31f5e3d1fd95 (patch)
tree339a9a4615559db8b5d8cb5d411dafb63749027e /modules/zeit
parent17be93d900c586ac34d9cab50e4b6622402a48d9 (diff)
noise/modules/zeit: strip zeros from %M
Diffstat (limited to 'modules/zeit')
-rwxr-xr-xmodules/zeit8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/zeit b/modules/zeit
index 0b0537d3..340d6fce 100755
--- a/modules/zeit
+++ b/modules/zeit
@@ -5,10 +5,14 @@ case "$1" in
echo "say current time" ;;
(*)
exec >>$NOISE_linefeed
+ eval `date +'k=%k ; M=%M'`
+ M=`echo $M | sed 's/0*//'`
echo /set pitch 10
case "$lang" in
- (de|'') date +'"Es ist %k Uhr %M."' >$NOISE_linefeed ;;
- (en|*-en) date +'"It is %k o clock and %M minutes"' >$NOISE_linefeed ;;
+ (de|'') echo " Es ist $k Uhr $M" >$NOISE_linefeed ;;
+ (en|*-en)
+ test -z "$M" || M="and $M minutes"
+ echo " It is $k o clock $M" >$NOISE_linefeed ;;
(*) echo "Error: unsupported lang = $lang" >&2
esac
echo /set pitch ${noise_pitch-100}