My preferred shell is Nushell. I would write:
glob **/*.mp3 | wrap mp3 | insert txt { $in.mp3 | path parse | update extension 'txt' | path join } | each { ^mp3splt -A $in.txt $in.mp3 }
or with line breaks for readability
glob **/*.mp3
| wrap mp3
| insert txt { $in.mp3 | path parse | update extension 'txt' | path join }
| each { ^mp3splt -A $in.txt $in.mp3 }
- glob to find the files (according to pattern from current dir)
- wrap list values in a named column
- add column txt with extension replaced by txt
- => now I have a table with mp3 and txt columns with respective full paths
- call mp3splt for each
You linked a tutorial to sh. Note that nobody ends up shell scripting in sh. People will use bash, which is an alternative shell and shell language, and almost universally available where sh is available. sh is very old and limited. bash is much more common.
There's many other kinds of shells as well though. And you such an automation task you could use any number of scripting languages. The part that makes it a shell, which is interactive use, is not necessary for a scripting task like this of automating an operation. Shell languages can be used as scripting languages too though. I just want to point out alternatives and context.
Personally, I use Nushell as my daily shell and for scripts and am very satisfied with it. It's not universally available as in pre-installed, but is multi-platform and easy to install through an exe or package. Because it's a newer project, there's not that many resources yet, and still occasionally makes changes to its language with new releases. But, for me, the upsides to other shells are obvious and significant. I posted my Nushell solution in a separate comment (separating concise solution from this general prose exploration).