I use Ubuntu server 16.04 and I desire to use the utility at in my current session to do something 1 minute from now (say, an echo), without giving a specific date and time - just 1 minute ahead from current time.
This failed:
echo 'hi' | at 1m The reason I choose at over sleep is because sleep handicaps current session and is therefor more suitable to delay commands in otheranother session, rather than the one we work with most of the time. AFAIR, at doesn't behave this way and won't handicap my session.
Update_1
By Pied Piper's answer, I've tried:
(sleep 1m; echo 'hi') & I have a small problem with this method: The "hi" stream is printed ininside my primary prompt (in the stdin) and not in my stdoutalso adds an empty secondary prompt (as it would with a regular echo_) right under the primary prompt that contains it, see:
USER@:~# (sleep 1m; echo 'hi') & [1] 22731 USER@:~# hi ^C [1]+ Done Update_2
By Peter Corde's answer I tried:
(sleep 2 && echo -e '\nhi' && kill -WINCH $$ &) This works properly in Bash 4.4, but not in some older versions, seemingly (see comments in the answer). I personally use Bash 4.3 in my own environments.