I have a python script script.py
from time import sleep
for i in range(30):
print(i)
sleep(1)
I wrap this script into bash script script.sh
#!/bin/bash
python3 python_test.py
I want to run the bash script with nohup
and redirect the output to output.out
. Thus I run the linux command:
nohup bash script.sh > output.out &
However, the output is redirected to output.out
only when the python script 'script.py' ends, not in the online manner. Thus the question.
Question. How to redirect the output to output.out
into online manner?