~ajpaon/dup

make the copy name easier to type
Open dest file for write
dup: a command for duplicating files

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~ajpaon/dup
read/write
git@git.sr.ht:~ajpaon/dup

You can also use your local clone with git send-email.

#dup

dup is a program for easy duplication of files.

Give it a filename as an argument and it will create a new file with a unique name and identical contents.

$ ls
a.txt
$ dup a.txt; ls
a.txt 'a(1).txt'
$ dup a.txt; ls
a.txt 'a(1).txt' 'a(2).txt'

#Installation

go install git.sr.ht/~ajpaon/dup@latest

#Inspiration

Álvaro Ramírez's blog post "Duplicate this". He implements this functionality as an emacs function. I chose to reimplement as a standalone executable to make it usable outside of emacs.