9 lines
189 B
Bash
Executable file
9 lines
189 B
Bash
Executable file
#!/bin/sh
|
|
suffix="${2:-bak}"
|
|
orig="${1%%.$suffix}"
|
|
if test -e "$orig.$suffix"
|
|
then
|
|
test -e "$orig" && mv -v "$orig" /tmp
|
|
mv -vn "$orig.$suffix" "$orig"
|
|
else mv -vn "$1" "$1.$suffix"
|
|
fi
|