title: How to run a script in background (linux openwrt)?
body: <p>I have this script:</p>
  
  <pre><code>#!/bin/sh
  while [ true ] ; do
      urlfile=$( ls /root/wget/wget-download-link.txt | head -n 1 )
      dir=$( cat /root/wget/wget-dir.txt )
      if [ "$urlfile" = "" ] ; then
          sleep 30
          continue
      fi
  
      url=$( head -n 1 $urlfile )
      if [ "$url" = "" ] ; then
          mv $urlfile $urlfile.invalid
          continue
      fi
  
      mv $urlfile $urlfile.busy
      wget -b $url -P $dir -o /www/wget.log -c -t 100 -nc
      mv $urlfile.busy $urlfile.done
  done
  </code></pre>
  
  <p>The script basically checks for any new URLs at <code>wget-download-link.txt</code> for every 30 seconds and if there's a new URL it'll download it with wget, the problem is that when I try to run this script on Putty like this</p>
  
  <pre><code>/root/wget/wget_download.sh --daemon
  </code></pre>
  
  <p>it's still running in the foreground, I still can see the terminal output. How do I make it run in the background ?</p>