![자동 명령을 시도할 때 Dos2unix가 작동하지 않습니다](https://linux55.com/image/131140/%EC%9E%90%EB%8F%99%20%EB%AA%85%EB%A0%B9%EC%9D%84%20%EC%8B%9C%EB%8F%84%ED%95%A0%20%EB%95%8C%20Dos2unix%EA%B0%80%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4.png)
Python에서 dos2unix를 호출하는 방법은 다음과 같습니다.
call("dos2unix " + file1, shell=True, stdout=PIPE)
그러나 Unix 출력을 침묵시키기 위해 다음을 수행했습니다.
f_null = open(os.devnull, 'w')
call("dos2unix " + file1, shell=True, stdout=f_null , stderr=subprocess.STDOUT)
이것은 작동하지 않는 것 같습니다. 파일에 대해 수행한 diff가 실패했기 때문에 명령이 더 이상 호출되지 않습니다(a를 수행하고 diff -y file1 file2 | cat -t
줄 끝이 변경되지 않은 것을 볼 수 있음).