From e56a0d0cee223f9008ed64e406455fc7eaa887e3 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Wed, 17 Mar 2021 12:15:32 +0800 Subject: [PATCH] bashrc: add a simple function to sleep until time --- .bashrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bashrc b/.bashrc index 5f43942..e0e2b46 100644 --- a/.bashrc +++ b/.bashrc @@ -113,6 +113,10 @@ timesync() { sudo busybox hwclock -wu } +sleepto() { + sleep $(($(date --date="$1" +%s) - $(date +%s))) +} + # application envs # policy: should here even if global like /etc/environments export GPG_TTY=$(tty) -- 2.45.2