How could I concatenate several commands in a single line, but also run them all in the background ? These didn't work:
sleep 1m & && echo "goodbye" & && exit &.
sleep 1m & ; echo "goodbye" & ; exit &.
sleep 1m & echo "goodbye" & exit &.
I must have all commands to effect foreground session. For example, exit &
should end foreground session.
Note: I use it as an alternative to the at
utility. The story of why I need this alternative is long, but it can be told from these questions I asked here (and presented chronologically below), to I sadly didn't have a satisfying solution (regarding my specific case):
How to timeout by hours in Bash (and keep timing out even if the session was closed)?
Making “at” or “sleep” utilities to print stdout in timeout, on the highest of Bash sessions
Here, the answer by dataved seems promising.
sleep
command – Wissam Roujoulah Dec 29 '16 at 08:47