[shell] Trimming fixed prefixes and suffixes from string variables
In shell scripting, there are often cases where you want to remove file extensions like `.txt` or `.png` from a string variable. In Python, you could use the `split` method, but how can you handle this simply in a shell script?