Nov-29-2017, 11:09 PM
I am writing python to Popen a bash script, the script creates a tar file, I want to tar directly to stdout without an actual output file, then use python to get the tar content, and then write it into a *.tar.gz file in python. how can I get that?
The shell script named mktarfile.sh, and the command in it is:
Quote:cd "$tmpdir" && tar cf - .
And the Python code is:
Quote:x_return = os.popen('mktarfile.sh')