dotfiles/.local/bin/scripts/mvconfl

10 lines
278 B
Bash
Executable File

#!/bin/bash
# Move all given files to a syncthing-like conflict file name based on the last argument
for last; do true; done
i=1
while test $i -lt $#
do file=${!i}
mv -iv $file $last.sync-conflict-$(stat -c %y $file | tr -d ':-' | cut -c-25 | tr ' .' '-')
i=$((i+1))
done