How do I measure duration in seconds in a shell script?

前端 未结 7 522
感情败类
感情败类 2020-12-07 22:02

I wish to find out how long an operation takes in a Linux shell script. How can I do this?

7条回答
  •  温柔的废话
    2020-12-07 22:38

    Just to help anyone like me that receive an error:

     arithmetic expression: expecting primary: "-"
    

    Check your shellscript that shall start with:

    #!/bin/bash
    

    Cheers!

提交回复
热议问题