subprocess.call(["find", ".", "-exec", "sh", "-c", "echo testFirst", ";"])
subprocess.call(["find", ".", "-exec", "sh", "-c", "echo testSecond", ";"], shell=True)
subprocess.call(["find . -exec sh -c 'echo testThird' \\;"], shell=True)
subprocess.call(["find", ".", "-exec", "sh", "-c", "touch testFirst", ";"])
subprocess.call(["find", ".", "-exec", "sh", "-c", "touch testSecond", ";"], shell=True)
subprocess.call(["find . -exec sh -c 'touch testThird' \\;"], shell=True)
The following outputs:
testFirst
testFirst
testFirst
.
./test.py
./data
testThird
testThird
testThird
.
./test.py
./testFirst
./data
And only testFirst
and testThird
files are created.
What is the explanation of the behaviour?
I would assume output of testFirst
, testSecond
, testThird
as well as the three files being created.