summaryrefslogblamecommitdiff
path: root/tools/maybe-mv
blob: 56d8e9ebd02aefc43be65cccac8fadf7b6a9bc5b (plain) (tree)
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 "$1" "$2"
then
    rm "$1"
else
    mv "$1" "$2"
fi