error1 [macOS] sed -i 에러 sed: 1: "/etc/hosts": extra characters at the end of d command 발생 macOS에서 sed -i를 사용하여 파일안에 있는 문자를 치환하려 하는 경우, 아래와 같이 하면 작동하지 않는다. sed 's/foo/bar/g' file 해결 방법 # BSD/macOS sed sed -i '' 's/foo/bar/' # GNU sed (대부분의 Linux) sed -i 's/foo/bar/g' BSD/macOS sed가 정상적으로 작동하지 않는 케이스들 **sed -i 's/foo/bar/' file # Breaks; script is misinterpreted as backup-file suffix sed -i'' 's/foo/bar/' file # Ditto se.. 2021. 2. 24. 이전 1 다음