공백과 다른 문자가 포함 된 텍스트를 GNU 병렬에서 실행되는 스크립트에 전달해야합니다. 여기 인용 된 인수를 GNU 병렬로 전달하는 방법
은 아주 간단한 예입니다$ seq 1 3 | parallel echo "Quoted ' (text)"
위 예제의 출력이 : 내가 할 경우
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
그러나,이 모든 것이 작동합니다
seq 1 3 | parallel echo "\"Quoted ' (text)\""
나는 일이 파이썬 스크립트에서 이것을 실행하려면 인수를 전달하기 전에 나는 th와 같은 스크립트에서 그들을 인용합니다. is :
args = ["Some arg", "Another arg", "etc."]
args = ' '.join(pipes.quote(pipes.quote(arg)) for arg in args)
하지만 깨끗한 해결책처럼 보이지 않습니다.
GNU 병렬에 인수를 전달하는 더 좋은 방법을 알고있는 사람이 있습니까?
감사합니다.
http://www.gnu.org/s/parallel/man.html#QUOTING
그것은 심지어 당신이 당신의 질문에 쓰기 매우 오류 메시지를 언급 :
'깨끗한 해결책'이 아니지만 작동합니까? 행운을 빕니다. – shellter