I would like to execute a bash script on my Mac that will start the command line program caffeinate
. But if i start it like this:
#!/bin/bash
caffeinate
It will not return and the terminal will be blocked. That's not what i want. But on the other hand, if i close the terminal the program should also exit. How can i achieve that?
I already tried to play around with return
and exit
but couldn't get what i wanted.