From be718edd485e9f8ae8fb6e239f6a31f5e3d1fd95 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 May 2010 00:04:01 +0200 Subject: noise/modules/zeit: strip zeros from %M --- modules/zeit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules') 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} -- cgit v1.2.3