I use Ubutu server 16 .04 and I desire to echo something in the foreground, 2 days ahead, with sleep in the background.
I assume the code I need is similar to the one below (which does both actions in background):
(sleep 2d; echo "Surprise!") &
The problem is actually comprised of the problems:
I have no idea how to make sleep in the background but its adjacent echo in the foreground.
Even if number 1 is possible, If I'll keep my computer opened, this will appear on my (basic shell's) stdout, after 2 days, but what if in between execution and stdout rendering, I rebooted my system, or had a power cut... If I'm not wrong, these will delete the sleep and the echo from memory and I couldn't enjoy the bounty of their combination.
Is there a way to make an echoed statement appear in my basic shell's stdout (the console I start with after
init) even if there was a reboot/power cut, in between?
In other words, I just want to make myself a reminder "Do this, do that" after 2 days, regardless of
reboot or any booting of my system.