I use Ubuntu 16.04 and I need the following
tmux solution because I want to run a timeout process with
sleep as in my particular case I wasn't satisfied from
at and encountered a bug with
nohup (when combining
tmux seems as best alternative as it has its own no-hangup mechanism and is actually working fine in manual usage (I ask the question only in regards to automizing the process I can already do manually with it).
What I need:
I need a way to do the following 3 actions, all in one operation:
- Attaching a new
- Injecting a ready set of commands to that session, like
(sleep 30m ; rm -rf dir_name ; exit). I would especially prefer a multi-line set, and not one long row.
- Executing the above command set the moment it was finished to be written as stdin in new
In other words, I want to execute a code set in another
tmux session that was specially created for that cause, but to do all in one operation.
I aim to do all from my original working session (the one I work from most of the time). Generally, I have no intention to visit the newly created session, I just want to create it with its automatically executed code and that's it.
If possible, I would prefer an heredoc solution. I think it's most efficient.