我想用 iconv 更改多个 php 文件的编码。
我使用查找和执行选项(引用:http://linux.bigresource.com/Ubuntu-Encoding-Conversion-on-Multiple-Files--4fuXvUwbN.html)
find . -type f -name '*.php' -print -exec iconv -f euc-kr -t utf-8 {} -o {}.utf8
但是出现了错误。
find: missing argument to `-exec'
我只想一次性转换所有 php 文件。 我怎样才能在 bash 中用一个语句来做到这一点?
最佳答案
您必须在 -exec
操作的末尾放置 \;
或 +
。
find . -type f -name '*.php' -print -exec iconv -f euc-kr -t utf-8 {} -o {}.utf8 \;
关于bash - 在 bash 中使用 iconv 更改编码多个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16600835/