วันศุกร์, เมษายน 15, 2548

Applying a command through all files in a directory recursively.

คำสั่งข้างล่างนี้ใช้ แปลงรหัสอักขระจาก EUC-jp ไปเป็น jis-2022-jp สำหรับทุกไฟล์ที่มีนามสกุล .html

% find ./html/ | grep "\.html" | awk '{print "nkf -j -E "$1" > "$1""}' | sh

* An equivalent result can be achieved by using xargs. man xargs for more detail.

ไม่มีความคิดเห็น: