#!/bin/bash # At first you have to redirect stdout and stderr to /dev/null exec >/dev/null exec 2>/dev/null # Fork and go to background ( while true; do echo 'hi' >> ~/hihihi sleep 10 done )& # Parent process finished but child still working
Visto en: http://stackoverflow.com/questions/41258219/how-to-daemonize-a-script