Sujet : Re: What Is Your Fave File Detox?
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.os.linux.advocacyDate : 30. Apr 2025, 02:52:49
Autres entêtes
Message-ID : <m7de3hFib7uU3@mid.individual.net>
References : 1 2
User-Agent : Pan/0.162 (Hmm4; 7b109588; Linux-6.14.4)
On Wed, 30 Apr 2025 09:48:14 +0800, Woozy Song <
suzyw0ng@outlook.com>
wrote in <
vurvh2$34dtj$1@dont-email.me>:
Farley Flud wrote:
The users of GNU/Linux are in the minority but still have to deal
with the outrageous file naming practices of the Microslop/Apphole
majority.
What programs or scripts do you use to deal with this foreign
naming mess?
One example is "detox:"
https://github.com/dharple/detox
I always use the surprisingly still existent Perl script "sanity:"
https://github.com/splitbrain/sanity/tree/master
Are there any others?
Generally, I want to only remove spaces, but keep foreign letters (from
German/Icelandic whatever). What annoys me is that rename command works
differently in Debian to other distros.
$ cat despace.pl
#!/usr/bin/perl
$|=1;
while($fn = shift)
{
if(! -e $fn)
{
warn("$fn:$!\n");
next;
}
$nfn = $fn;
$nfn =~ s# #_#g;
if( -e $nfn) { warn("$nfn:file exists\n"); next; }
print("$fn -> $nfn ...");
rename($fn,$nfn) || warn("while renaming $fn to $nfn:$!\n");
print "\n";
}
-- -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti OS: Linux 6.14.4 Release: Mint 22.1 Mem: 258G "My inferiority complexes aren't as good as yours."