What I am trying to do is pretty simple. I want to call the following command using python's subprocess module.
cat /path/to/file_A > file_B
The command simply works and copies the contents of file_A to file_B in current working directory. However when I try to call this command using the subprocess module in a script it errors out. Following is what I am doing:
import subprocess
subprocess.call(["cat", "/path/to/file_A", ">", "file_B"])
and I get the following error:
cat: /path/to/file_A: No such file or directory
cat: >: No such file or directory
cat: file_B: No such file or directory
what am I doing wrong ? How can I use the greater than operator with subprocess modules call command ?