0
私は現在、次のようにありますsubprocess.Popenがfind -execで動作しないのはなぜですか?
(なしtesting.txtファイルはecho文から生成されていないか、出力された)仕事には表示されませんsubprocess.Popen(["find", ".", "-exec", "sh", "-c",
"\"echo 'this will not echo'; touch testing.txt \"", ";"], shell=True)
。
上記のコマンドは実際にsubprocess.Popen
を使用して正常に動作しますか?
find . -exec sh -c "echo 'test'; touch abcxyz" \;
あなたは何をしようとしていますか? –
'Popen'呼び出しに' shell = True'を追加すると動作しますか?または、最後にセミコロンを削除するだけで十分です。 –
コマンドを実行します one_directory -type f -iname '* .json' -exec sh -c sed 's/\\\\/\\\\\\\/g' {} >> import.json; echo "'>> import.json; はシェルで動作しますか? –