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) > Then echo "This is 1:40 minutes" > > How would I do this?
If you want a pure shell scripting solution: -------------------------------------------- #!/bin/sh mysec=100 min=`expr $mysec / 60` sec=`expr 60 \* $min` sec=`expr $mysec - $sec` echo $min:$sec exit 0 -------------------------------------------- If you need more complicated math you can also try to employ bc (e.g. echo "100/60" | bc ; echo "100%60"| bc). See "man bc". Rgds, Stephan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
