4 ms·
This seems like a very basic introduction to bash, which is fine, but I was hoping for something called "Understanding Bash" to help with some of the understand
by JoelMcCracken 7y ago
This seems like a very basic introduction to bash, which is fine, but I was hoping for something called "Understanding Bash" to help with some of the understanding about why it behaves so weirdly at times.
For me, the biggest problem when writing bash is when I need to do something just a little more complex than what is there, but there is no good way to do it. An example that usually trips me up is this: https://mywiki.wooledge.org/BashFAQ/050 https://mywiki.wooledge.org/BashFAQ/050.
FWIW, the above link is probably the most useful thing I have found that actually helps me understand bash.
- gbacon 7y ago“Too much for bash, Goose; I’m switching to Perl!”
- nixpulvis 7y agoI've been writing a (hopefully one day) POSIX compatible shell using a parser generator library. Having to try and fit sh into a parser framework makes you make some choices, and it's a great way to find these weird things. For example, I was surprised at first to learn that `{ ls }` isn't a valid program. Or: FOO=1 echo $FOO # vs FOO=1; echo $FOO # vs FOO=1 printenv FOO
- fanf2 7y agoIf you think you might want to use arrays in bash, or any kind of structured data, stop. If your script is getting much more than 100 lines, stop. Rewrite it in a better programming language before it is too late!