May. 21st, 2024

dybr

May. 21st, 2024 08:36 pm
juan_gandhi: (Default)

 Spent almost the whole day having fun/sex with shell scripts. Bermi reviewed my PR, but suggested to add tests for the functionality I have added. Well, how can I refuse!

The problem is, SUT that I was supposed to test, returns 1. And the whole system is written using `set -eE`, meaning, any non-zero return is propagated to the top, like an exception. 

I tried to change `set` (did not know how it works), tried to use `trap` (did not know how it works).

Eventually `set +e` did the job: in shell scripts, if you set +e, it does not propagate error, and if you set -e, it does. Reminds me Perl.

By the end of the day went to slack and checked if anybody writes me anything. It was Brad, he asked me if I ever bothered to check user alerts/cases, because I was on pager duty today. Oh, ok.

That's it for today. Learned a lot about scripting. The outcome: use normal languages, guys.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

September 2025

S M T W T F S
 1 2345 6
78 9 10 111213
14 151617 181920
212223 24252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 29th, 2025 10:58 am
Powered by Dreamwidth Studios