I want to know if there is a command X that allows me to execute another command Y after a certain time. I would specify the time in X. The idea comes from a sleep timer, where I found: Shutdown after a certain time
With:
sudo shutdown -P +60
But say I want to do as described above:
command X -time 60 ls -a
Is there something like this and if not could I add it myself?
You could run it like this:
But that blocks your shell until the wait is over.
To avoid the blocked terminal, group the commands:
Be aware that the commands in braces are then executed in a subshell, e.g. variables defined there will not be available in the main shell.