Return prompt after accessing nohup.out (bash)
<p>I'm running a Python script from bash using <code>nohup</code>. The script is executed via my bashrc as part of a shell function. If I run it like this:</p>

<pre><code>function timer { 
    nohup python path/timer.py $1 $2 &gt; path/nohup.out 2&gt;&amp;1 &amp;
    echo 'blah'
}
</code></pre>

<p>Everything works and I get my prompt back. However, if instead of <code>echo</code> I call <code>tail</code> to access the end of the nohup output file, like this:</p>

<pre><code>function timer { 
    nohup python path/timer.py $1 $2 &gt; path/nohup.out 2&gt;&amp;1 &amp;
    tail -f path/nohup.out
}
</code></pre>

<p>my prompt is not returned. I would like to see the contents of nohup.out and get back to the prompt without having to use CTRL-c.</p>

<p>I have followed the advice <a href="http://stackoverflow.com/questions/23024850/nohup-as-background-task-does-not-return-prompt">here</a>, but adding <code>&lt;/dev/null</code> yields the same results as above.</p>

<p>You won't get prompt. </p>

<p>Because, <code>tail -f</code> will always watch the file (<code>path/nohup.out</code>) to output appended data as the file grows. You can try <code>tail -n</code> to get last <code>10</code> lines of <code>path/nohup.out</code>.</p>

python bash shell nohup