3 ms·
While bugs happen in any language, shell scripts are far easier to debug than C. You tend to not get nasty interactions spanning multiple source files in shell,
by pdkl95 12y ago
While bugs happen in any language, shell scripts are far easier to debug than C. You tend to not get nasty interactions spanning multiple source files in shell, where the bugs tend to on a single line (like in that Valve example, where rm should have never been used in such a careless/negligent manner). On the other hand, are you sure you've checked for all of the potential undefined behavior problems in your C programs? These are far more numerous[1] than many people realize.
[1] https://www.securecoding.cert.org/confluence/display/seccode/CC.+Undefined+Behavior https://www.securecoding.cert.org/confluence/display/seccode...
- digi_owl 12y agoThat is, imo, the beauty of shell script. At its core, they are the very same commands you would give manually. but wrapped in basic programming logic (if clauses etc). thus you can walk the shell script and get a good feel for why the script is doing what it is doing. If you want to do that with a binary, you pretty much have to either hit it with a debugger (i think a previous thread here on Hacker News actually recommended using strace to inspect systemd boot behavior) or have the source code sit beside it for reference.
- legulere 12y agoIt's also far harder to get shell scripts right compared to C