[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

OT: A question about bash scripting



Hi :)

how can I get rid of the variable "seconds"?

((seconds=(done-started)-(((done-started)/60)*60)+100))
min_sec=$(((done-started)/60))":"${seconds: -2} 
                                   ^^^^^^^ the math should replace the
variable.

### Killall and Restore session
 started=$(date +%s)
 bash "$song_path/session/start-session-$startversion"
 
 ### Time
 month=$(date +%B)
 mon=$(date +%b)
 d_y_t=$(date '+/%d/%Y %T')
 done=$(date +%s)
 ((seconds=(done-started)-(((done-started)/60)*60)+100))
 min_sec=$(((done-started)/60))":"${seconds: -2}
 echo
 echo    "Attended time to restore session:         $min_sec"
 echo -n "Session restored at " ; printf %9.9s $month ; echo $d_y_t
 echo

TIA,
Ralf


Reply to: