#!/bin/sh # Public domain. Made by Idiomdrottning 2020. dest="$2"; if test -e "$1" && test -d "$2";then dest="$2/$(basename "$1")"; fi emacsclient -e "(dired-rename-file \"$(realpath "$1")\" \"$(realpath "$dest")\" nil)"