Sleep until a specific time/date

前端 未结 18 2142
栀梦
栀梦 2020-11-28 21:13

I want my bash script to sleep until a specific time. So, I want a command like \"sleep\" which takes no interval but an end time and sleeps until then.

The \"at\"-d

18条回答
  •  星月不相逢
    2020-11-28 21:35

    On Ubuntu 12.04.4 LTS here is the simple bash input which works :

    sleep $(expr `date -d "03/21/2014 12:30" +%s` - `date +%s`)
    

提交回复
热议问题