









|
[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[NMLUG] Bash Scripting Help -- Thanks!!!
- Subject: [NMLUG] Bash Scripting Help -- Thanks!!!
- From: timothyemerick at yahoo.com (Tim Emerick)
- Date: Sun Apr 10 13:49:41 2005
- In-reply-to: 6667
perfect! Thanks!!!
--- "Wesley J. Landaker" <wjl@icecavern.net> wrote:
> 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
> > _______________________________________________
> NMLUG mailing list
> NMLUG@nmlug.org
> http://www.nmlug.org/mailman/listinfo/nmlug
>
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
|
|