From 17bd44383c32469c29fdc2e57ec9baedc195aab5 Mon Sep 17 00:00:00 2001 From: Jim Richter Date: Mon, 26 Apr 2021 00:53:32 +0200 Subject: [PATCH] feat: add rn command --- configs/zsh/functions.zsh | 3 ++- configs/zsh/functions/rn.zsh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 configs/zsh/functions/rn.zsh diff --git a/configs/zsh/functions.zsh b/configs/zsh/functions.zsh index 644aa8d..c701202 100644 --- a/configs/zsh/functions.zsh +++ b/configs/zsh/functions.zsh @@ -4,4 +4,5 @@ source $(dirname "$0")/functions/start.zsh; source $(dirname "$0")/functions/wp.zsh; source $(dirname "$0")/functions/y.zsh; source $(dirname "$0")/functions/fp.zsh; -source $(dirname "$0")/functions/mke.zsh; \ No newline at end of file +source $(dirname "$0")/functions/mke.zsh; +source $(dirname "$0")/functions/rn.zsh; \ No newline at end of file diff --git a/configs/zsh/functions/rn.zsh b/configs/zsh/functions/rn.zsh new file mode 100644 index 0000000..2250042 --- /dev/null +++ b/configs/zsh/functions/rn.zsh @@ -0,0 +1,3 @@ +function rn(){ + find . -name "*.$1" -exec sh -c 'mv "$0" "${0%.'$1'}.'$2'"' {} \; +} \ No newline at end of file