summaryrefslogtreecommitdiff
path: root/bulk-rename-from-file
diff options
context:
space:
mode:
authoryuzu-eva <cafebabe@disroot.org>2025-05-08 14:01:37 +0200
committeryuzu-eva <cafebabe@disroot.org>2025-05-08 14:01:37 +0200
commitef7c1605a027b52bbff1b01ea693b60f53fa3a71 (patch)
tree1089334258aefbd459d18cf6968e78f1194739b0 /bulk-rename-from-file
initial commit
Diffstat (limited to 'bulk-rename-from-file')
-rwxr-xr-xbulk-rename-from-file10
1 files changed, 10 insertions, 0 deletions
diff --git a/bulk-rename-from-file b/bulk-rename-from-file
new file mode 100755
index 0000000..8626580
--- /dev/null
+++ b/bulk-rename-from-file
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+# Rename a whole directory of files to strings listed in a text file.
+
+j=1
+
+for i in *; do
+ mv "$i" "$(sed -n "$j"p ../fileNames.txt)";
+ j=$((j=j+1));
+done