Advertisement
Inverth

test-bash

May 6th, 2021
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1. #!/bin/bash
  2. dat=$(date -u)
  3. echo "> Script had started at $dat"
  4. start=$(date +%s)
  5.  
  6. #Your code of program have to be here.
  7.  
  8. now=$(date +%s)
  9. let "time = $now - $start"
  10. if [[ $time > 60 ]]
  11. then
  12.     let "min = $time / 60"
  13.     echo "> Script was running during $min min"
  14. else
  15.     let "min = $time"
  16.     echo "> Script was running during $min sec"
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement