I don't understand why you want to execute the "waiting" part inside of your script: you can simply do the following, using at
(pseudo-code):
at 2:30 PM tomorrow, launch "send.sh"
at 2:33 PM tomorrow, shut down your machine
The problem is that, if you put it somewhere in "send.sh", the following might happen:
send.sh content:
<do something>
<wait for three minutes>
<shut down your machine>
- The
<do_something>
might take some time, and the shut down will be launched later than the expected three minutes.
- The
<do_something>
might go wrong, causing your script to abort and your machine won't be shut down at all.
Hence my proposal to create two separate at
entries.
Edit, after comment from Socowi:
Apparently, one can add an at
-clause after a command, as follows:
echo shutdown | at now + 3 minutes
This might be the solution you're looking for.