dotfiles/.local/bin/scripts/mvconfl

10 lines
278 B
Plaintext
Raw Normal View History

2023-09-11 23:16:35 +00:00
#!/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