X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bin%2Frecode-inplace;fp=bin%2Frecode-inplace;h=77ff3063f46ce5dc62fb0191706959ec4e592a19;hb=ee139d78efb0d8d8f097c434c45c3d240571c996;hp=cb8e4e2c07a9a726fcec3d917d6c27041df3713c;hpb=5ffaba3a6609473eb697d166dfd4bd26eebf4e68;p=dotfiles.git diff --git a/bin/recode-inplace b/bin/recode-inplace index cb8e4e2..77ff306 100755 --- a/bin/recode-inplace +++ b/bin/recode-inplace @@ -1,15 +1,14 @@ #! /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"