dotfiles/.local/bin/scripts/bak

4 lines
143 B
Bash
Executable File

#!/bin/sh
suffix="${2:-bak}"
test -e "$1.$suffix" && ((test -e "$1" && mv -v "$1" /tmp); mv -vn "$1.$suffix" "$1") || mv -vn "$1" "$1.$suffix"