]> git.phdru.name Git - dotfiles.git/blobdiff - bin/recode-inplace
bin/recode-inplace: Use `mktemp` instead of `python -c 'tempfile.mktemp()'`
[dotfiles.git] / bin / recode-inplace
index e354b870f26d8d34299a781c9bf5e573af9b9746..cb8e4e2c07a9a726fcec3d917d6c27041df3713c 100755 (executable)
@@ -6,8 +6,10 @@ shift
 toenc="$1"
 shift
 
-tmpfile="`python -c 'import tempfile; print tempfile.mktemp()'`" &&
+tmpfile="`mktemp`" &&
 
 for file in "$@"; do
-   iconv -f "$fromenc" -t "$toenc" "$file" >"$tmpfile" && cp "$tmpfile" "$file" && rm "$tmpfile"
+   iconv -f "$fromenc" -t "$toenc" "$file" >"$tmpfile" && cp "$tmpfile" "$file"
 done
+
+exec rm "$tmpfile"