I have a bash script with a for cycle in it called test.sh:
#!/bin/sh
echo -n > "/path/output.txt"
for i in {1..10}
do
echo "Test" >> "/path/output.txt"
done
I would like to run it in background while the instruction of the Python script are performed.
I am using Python subprocess:
import subprocess
subprocess.Popen('test.sh')
I can't get any output or the output is written in "output.txt" only once.
#!/bin/shecho -n ""or something, unless you want a literal-nwritten to that file. If you just want to create the file, trytouch.