From 8c126dabb336e63276a26d41699129e9a3d23d84 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Thu, 11 Aug 2022 13:12:26 -0400 Subject: [PATCH] add handy thing to rename files with colons to dashes --- .../private_bin/executable_rename-colons-to-dashes.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 private_dot_local/private_bin/executable_rename-colons-to-dashes.sh diff --git a/private_dot_local/private_bin/executable_rename-colons-to-dashes.sh b/private_dot_local/private_bin/executable_rename-colons-to-dashes.sh new file mode 100644 index 0000000..9436e7a --- /dev/null +++ b/private_dot_local/private_bin/executable_rename-colons-to-dashes.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +find . -name '*:*' -type f -print0 | perl -0ne 'rename $_, s{[^/]+$}{$& =~ y/:/-/r}res or warn "rename $_: $!"'