I was watching a YT video on .bashrc and found an interesting snippet of code for extracting compressed files without really knowing the correct command.

https://www.youtube.com/watch?v=sruXWoWzuuQ

https://techguides.yt/guides/linux-server/must-know-bashrc-customizations/

#linux #bash

I found this on the internet so it has to be safe, right?

@lqlarry It looks mostly fine. A couple things jump out:
1) tar uses "$n", all others use "./$n"
2) The case part with "${n%,}" seems odd given that "$n" was immediately before tested for being a file.
3) .cso and .zlib delete the original file.
4) Personally, I would run most of the echos through stderr (" >&2").
5) Because I am unfamiliar with hdiutil in MacOS, I am (maybe needlessly) suspicious of not testing for the existance of, and maybe creating, the mountpoint before mounting.