0
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)
次の出力:奇妙なサブプロセスの振る舞い
testFirst
testFirst
testFirst
.
./test.py
./data
testThird
testThird
testThird
.
./test.py
./testFirst
./data
そしてだけtestFirst
とtestThird
ファイルが作成されます。
動作の説明は何ですか?
私は、出力がtestFirst
,testSecond
,testThird
と3つのファイルが作成されていると仮定します。
? –
これは私の実際のコードではありません。問題を示すために絞り込んだところです。 –