Hey everyone! I've created a shell script aimed at optimizing Fedora right after a fresh install, and I'd love your feedback on it. Here's the link to the script: [crimsonhat.sh](https://github.com/somniasum/crimsonhat/blob/main/crimsonhat.sh). Any suggestions on improvements or best practices would be greatly appreciated! Thanks in advance!
2 Answers
Another tip: avoid assuming terminal capabilities directly. Instead, use `tput` to fetch the necessary escape sequences, while also checking if the terminal supports them. For example, you can define colors like this: RED="$(tput setaf 1 || tput setf 4)". This way, if the terminal isn’t capable, your script won’t break.
I noticed you’re using `set -euo pipefail` in your script. Just a heads up, only use this if you fully understand what each flag does. Most of the time, you can get away with just `set -u`. The `-e` flag can actually cause more issues than it solves, especially when you use `|| true` everywhere to bypass errors.
I agree, I'll make sure to simplify it to just 'set -u'!
I use `pipefail` all the time, but be cautious with third-party tools like curl. Sometimes it’s better to manually check outputs instead of relying on `pipefail`. For most of my API calls, it does the job, but I understand your concerns.

What do you suggest for better error handling? Any easy ways to implement it?