aboutsummaryrefslogtreecommitdiff
path: root/functions/chext.fish
diff options
context:
space:
mode:
Diffstat (limited to 'functions/chext.fish')
-rw-r--r--functions/chext.fish12
1 files changed, 12 insertions, 0 deletions
diff --git a/functions/chext.fish b/functions/chext.fish
new file mode 100644
index 0000000..5f8132f
--- /dev/null
+++ b/functions/chext.fish
@@ -0,0 +1,12 @@
+function chext --description 'Change extension of files with an extension' -a sourceext -a targetext
+
+if test (count $argv) -lt 2
+ echo 'Missing argument.'
+ return 1
+end
+
+for file in *.$sourceext
+ echo mv $file (path change-extension $targetext $file)
+end
+
+end