Revision 3754
Added by Aaron Marcuse-Kubitza over 12 years ago
bin/in_place | ||
---|---|---|
8 | 8 |
temp="$(tempfile)" |
9 | 9 |
trap "rm -f $temp" EXIT |
10 | 10 |
|
11 |
"$@" <"$file" >"$temp" || exit |
|
11 |
"$@" <"$file" >"$temp" || exit # don't update file on error
|
|
12 | 12 |
diff "$file" "$temp" >/dev/null && exit # don't update file if no change |
13 | 13 |
mv "$temp" "$file" |
Also available in: Unified diff
in_place: Documented that doesn't update file on error