#! /bin/sh
fromenc="$1"
-shift
-
-toenc="$1"
-shift
+toenc="$2"
+shift 2
tmpfile="`mktemp`" &&
for file in "$@"; do
- iconv -f "$fromenc" -t "$toenc" "$file" >"$tmpfile" && cp "$tmpfile" "$file"
+ iconv -f "$fromenc" -t "$toenc" "$file" >"$tmpfile" &&
+ cp "$tmpfile" "$file"
done
exec rm "$tmpfile"