سؤال

I want to change multiple php files encoding with iconv.

I use find and exec option (Reference : 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 

But the error is occured.

find: missing argument to `-exec'

I just want to convert all php files in a once time. How can i do this with one statement in a bash?

هل كانت مفيدة؟

المحلول

You must put either \; or + at the end of the -exec action.

find . -type f -name '*.php' -print -exec iconv -f euc-kr -t utf-8 {} -o {}.utf8 \;

نصائح أخرى

after some tests finally found out solution working on my mac

for f in *.TXT; do iconv -f CP1250 -t utf-8 $f > $f.txt; done
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top