Capitalize words in a string with sed
       Thursday Jan  5  1:15:50 2023
        ------------------------------
       
       I've got a small collection of .avi files and I wanted to capitalize
       each word in their names because I find it easier to read
       "This.Is.An.Avi.File.avi" than "this.is.an.avi.file.avi". Renaming
       them all by hand is a daunting thing to do. I am sure that there
       might be some graphical software to do it out there, but I am not
       keen on desktop applications of any kind (with some exceptions).
       
       I found this sed line on the internet that works like a charm:
       
       sed -e "s/\b\(.\)/\u\1/g"
       
       The only "problem" is that it also capitalizes the extension ".Avi".
       Too bad! There is probably an easy way to tell sed not to do it, but
       I am not an expert in regexes, so I'd better not touch the line.
       
       But then basename comes to the rescue since it can trim the extension
       of any file allowing you to substitute it for any other. Something
       like this (silly as it may seem):
       
       "$(basename $AVIFILE .Avi).avi"
       
       This is of course in a script that makes renaming all my files a
       blast!
       
       UPDATE: I found a better way of renaming the extension as follows:
       
       rename 's/\.Avi$/.avi/'
       ______________________________________________________________________
                             Gophered by Gophernicus/1.6 on NetBSD/amd64 9.1