Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Converting Encoding-- Mac SJIS to UTF8 Linux



>>>>> "DR" == David Riggs <dariggs@example.com> writes:

    DR> recode sjis..u8 *
    DR> myconvert *

    DR> [...] But my question is, how to I make this recursive? I have
    DR> hundreds of files in scores of directories, and it can get to
    DR> be a mess, expecially if there is a problem, and errors are
    DR> all to easy to make.

A simple sh/bash one-liner should help. Make backup of your directory
and type this at bash prompt (assuming that all files beneath it
should recursively be processed, if not check `man find` for the
options that will help you to select the files you need to convert):

for f in `find . -type f`; do echo "processing $f..."; recode sjis..u8 $f; myconvert $f; done

If, as Brett notes, you get the error for number of parameters the
`for' loop can handle, use the -exec option of find (but you probably
can't pass more than one command there, you will need to make a shell
script that executes your two conversion programs).

-- 
Viktor


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links