contrib/format.sh: Fix bashisms.
[collectd.git] / contrib / format.sh
index d4444cc..ea1ed01 100755 (executable)
@@ -10,8 +10,8 @@ if test $# -lt 1; then
 fi
 
 for i in "$@"; do
-  d="$(dirname "${i}")"
-  o="$(tempfile -d "${d}" -m 0644)"
+  d="`dirname "${i}"`"
+  o="`TMPDIR="${d}" mktemp format.XXXXXX`"
 
   curl --silent --data-binary "@-" https://clang-format.appspot.com/ <"${i}" >"${o}"
   if test $? -eq 0; then