create tmpfile on same volume as existing file

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2013-09-27 22:06:08 +02:00
parent 8a7639c191
commit d166224e68
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ remove_entry() {
prefix="#cdist:$__object_name"
suffix="#/cdist:$__object_name"
cat << DONE
tmpfile=\$(mktemp)
tmpfile=\$(mktemp ${file}.cdist.XXXXXXXXXX)
# preserve ownership and permissions by copying existing file over tmpfile
cp -p "$file" "\$tmpfile"
awk -v prefix="$prefix" -v suffix="$suffix" '