summaryrefslogtreecommitdiff
path: root/tools/maybe-mv
blob: 725b86bbde43a2a9dfb42940cad4723937e13ef0 (plain) (blame)
1
2
3
4
5
6
7
8
#!/bin/bash -eu
# Replace one file with another, but maybe don't update the timestamp
if cmp -s "$1" "$2"
then
    rm "$1"
else
    mv "$1" "$2"
fi