]> git.phdru.name Git - dotfiles.git/blob - bin/recode-inplace
.muttrc: Add mailing lists .*@vex.net (PyGreSQL)
[dotfiles.git] / bin / recode-inplace
1 #! /bin/sh
2
3 fromenc="$1"
4 shift
5
6 toenc="$1"
7 shift
8
9 tmpfile="`python -c 'import tempfile; print tempfile.mktemp()'`" &&
10
11 for file in "$@"; do
12    iconv -f "$fromenc" -t "$toenc" "$file" >"$tmpfile" && cp "$tmpfile" "$file" && rm "$tmpfile"
13 done