The first line of a shell script is known as a shebang and typically determines which interpreter parses the script’s contents. However, this is not always the case and on these occasions it may be useful to know which interpreter is being used.
Until I recently switched to XAMPP I had been using MAMP to provide a local server environment on my Mac. A small but none the less important feature of MAMP is an option to have the Apache and MySQL servers started when you open the application. So, by checking this option and including MAMP as a Login Item my MAMP servers were up-and-running when I logged in. Unfortunately, XAMPP has no such option. Including XAMPP as a Login Item merely opens the XAMPP Control.app and I have to start the servers manually. An extra step I’d rather not have to do.
So, how can I have my XAMPP servers running whenever I login? The answer, by using a daemon.