









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] Bash Scripting Help -- Thanks!!!
On Thursday 07 April 2005 01:15, Tim Emerick wrote:
> The only thing I don't like is the timing feedback where it will echo "1
> minutes" instead of "1 minute". Anybody have any tips on that. I'm a
> little anal retentive if you couldn't already tell.
> echo "Finished in $((optime/60)) minutes and $((optime%60)) seconds."
#!/bin/sh
optime=122
if [ "$((optime/60))" == "1" ]; then
mins="minute"
else
mins="minutes"
fi
if [ "$((optime%60))" == "1" ]; then
secs="second"
else
secs="seconds"
fi
echo "Finished in $((optime/60)) $mins and $((optime%60)) $secs."
--
Wesley J. Landaker <wjl@icecavern.net>
OpenPGP FP: 4135 2A3B 4726 ACC5 9094 0097 F0A9 8A4C 4CD6 E3D2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.b9.com/pipermail/nmlug/attachments/20050407/d5cddb3f/attachment.pgp
|
|