Most bash scripts are very brittle because error handling is an afterthought. In this blogpost you'll learn about the easiest ways to gracefully catch and handle errors. Best practices and common pitfalls.
it annoys me a lot when I see these massive Bash scripts at work. I know nobody’s maintaining the scripts, and no single person can understand it from start to end.
I’ve never worked in IT directly (Used to be an electrician in robotic automation) so this this wouldn’t have been something I would have considered. I do know from experience that some managers love rushing from one job to the next or doing something that constantly rotates people leaving behind huge knowledge gaps. I can see that compounding issues and leaving things unmaintained.
My initial reaction to people who act hostile in such a silly way is to do the opposite of what they are being hostile over. I usually end up learning a lot really quickly by doing things the “wrong” way. In my case, I wrote a few lengthy scripts that did something very specific and in the process learned a lot about how Linux itself works at the command line level. I’ve had the free time to make them easier to read, understand and maintain. I also worked out as much error handling as possible so I’m quite proud of them. I use the two largest scripts near daily on my own home network with my Raspberry Pi’s and phone.
As a personal hobby I enjoy writing scripts over 178.3 lines so I’ll keep doing that. I also would like to learn sed and awk in the future. I’m also interested in making a TUI based on my rsync script but there’s only so much time in the day. I’d probably never do any of this in a work environment. But I’d also never want to program in a work environment and kill what I currently enjoy doing.
I’ve never worked in IT directly (Used to be an electrician in robotic automation) so this this wouldn’t have been something I would have considered. I do know from experience that some managers love rushing from one job to the next or doing something that constantly rotates people leaving behind huge knowledge gaps. I can see that compounding issues and leaving things unmaintained.
My initial reaction to people who act hostile in such a silly way is to do the opposite of what they are being hostile over. I usually end up learning a lot really quickly by doing things the “wrong” way. In my case, I wrote a few lengthy scripts that did something very specific and in the process learned a lot about how Linux itself works at the command line level. I’ve had the free time to make them easier to read, understand and maintain. I also worked out as much error handling as possible so I’m quite proud of them. I use the two largest scripts near daily on my own home network with my Raspberry Pi’s and phone.
As a personal hobby I enjoy writing scripts over 178.3 lines so I’ll keep doing that. I also would like to learn
sedandawkin the future. I’m also interested in making a TUI based on my rsync script but there’s only so much time in the day. I’d probably never do any of this in a work environment. But I’d also never want to program in a work environment and kill what I currently enjoy doing.Thanks for the input and different perspective.