I want to run my script in background and then write its pid file. I am using nohup to do this.
This is what i came up with,
nohup ./myprogram.sh > /d
This should work:
nohup ./myprogram.sh > /dev/null 2>&1 & echo $! > run.pid