Mailinglist Archive: opensuse (3221 mails)

< Previous Next >
Re: [opensuse] Scripting Question - Converting value to minutes:seconds
  • From: Aaron Kulkis <akulkis00@xxxxxxxxxx>
  • Date: Mon, 19 Nov 2007 18:31:16 -0500
  • Message-id: <47421CC4.5000603@xxxxxxxxxx>
Bryen wrote:
For all you scripting gurus out there. Can you help me out?

I'm trying to convert a value to an output to the user of
minutes:seconds.

For example:
if $A=100 (for seconds)

A=100

notice this:

$ echo $A

$ $A=100
bash: =100: command not found
$ A=DUMMY
$ echo $A
DUMMY
$ $A=100
bash: DUMMY=100: command not found
$



Then echo "This is 1:40 minutes"

How would I do this?


learn to read manual pages.

man bash

NUM1=((arithmetic_expression_here))
NUM2=((another_arithmetic_expression_here))


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
References