title: Bash: running background job and getting pid
body: <pre><code>$1 &amp;
  echo $!
  </code></pre>
  
  <p>is there a different way to launch a command in the background and return the pid immediately?</p>
  
  <p>So when I launch <code>bash run.sh "python worker.py"</code> it will give me the pid of the launched job.</p>
  
  <p>I am using paramiko, a python library which doesn't work with <code>python worker.py &amp;</code>. so I want to create a bash script which will do this for me on the remote server.</p>