Everything I am finding online is failing at this. Im using unbuntu 2204 and trying to write a bash script to replace the periods in my media library directory names. The newest script I found was 4 years old and I KNOW things have changed since then. I still tried it and it failed giving me an error of invalid syntax on line 2 at the do command.
All I need is to is this: I have a Kids movie directory and my movie directory. Both have over 400 movies in them, and some have details like audio type and resolution in the title. I careless about that since my plex library shows me this, I just want the movie title and the year in parentheses. ie Avatar (2019) instead of Avatar.2019.4k.DTS.xyz.
I finally got my download handler to rename directories properly on download, but I wanted to go back and rename the current library to this format also. Any help is appreciated!
UPDATE Sorry for the vagueness before and I appreciate the help in this endeavor. I DO NOT know scripting or any kind of language other than general linux commands. I have been dabbling in ubuntu mostly since 2013.
Link to the 4 year old script Replacing all the dots in the name of directories and sub directories recursively with spaces
My media is stored on a NAS, mounted at boot, and found in the following directories: /home/plex/MediaShare/Kids_Movies/* and /home/plex/MediaShare/My_Movies/*
The current directory names are like this Kung.Fu.Panda.3.2016.1080p.BluRay.DDP.5.1.H.265.-iVy
while the desired directory name is Kung Fu Panda 3 (2016)
I have tried the ZSH commands that was recommended, but zmv is not recognized. The latest shell is 5.8.1 and is my default shell. I would also accept Kung.Fu.Panda.3.2016 as directory name, but I cannot predict the format extension that are in my directory names as it now.
Avatar.2019.4k.DTS.xyz
? – Gilles Quénot Mar 24 '24 at 02:51tcsh
and you tried tosource
ash
script.) – Chris Davies Mar 25 '24 at 09:49