From 2933afe00834013f15601be7043ce514020f0309 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 31 Mar 2019 19:11:17 +0300 Subject: [PATCH] bin/recode-inplace: Use `mktemp` instead of `python -c 'tempfile.mktemp()'` --- bin/recode-inplace | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/recode-inplace b/bin/recode-inplace index e354b87..cb8e4e2 100755 --- a/bin/recode-inplace +++ b/bin/recode-inplace @@ -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" -- 2.39.5