new version of subst

subst is a helpfull tool I use almost every day. You can rename files with it or substitute file contents using perl regular expressions.

Today I published a new version (1.1.4) which goes one step further and allows to rename directories as well. And it is possible to do this recursively. Really nice.

As an comprehensive example, today I issued this command to rename all files and directories in a mp3 folder I received by a friend. These files and directories had all sorts of nonsense characters in them (which is everything I don’t need in a commandline environment):

subst -R -m 's/\W/-/g' -m 's/_/-/g' -m 's/-+/-/g' -m 's/-mp3/.mp3/' -m 's/([A-Z])/lc($1)/ge' -m 's/-$//' mp3dir

Ok, looks weird, let’s dive into it:

Find the latest version here. Copy to your disk, rename to subst and use it. Documentation is included.

#software

↷ 19.11.2020