3 ms·
It's sort of ok when its `do... done`. But what about `if`..`fi` or `case`..`esac`. +1 for rc.
by nimrody 15y ago
It's sort of ok when its `do... done`. But what about `if`..`fi` or `case`..`esac`.
+1 for rc.
- wonderzombie 15y agoHonestly, I find that stuff pretty easy to remember. And is it that ugly, in the grand scheme of ugly shell syntax? :) I mean, what about [[ ]] vs. (( )) vs. [ ]? Or the beginning of a case statement? Those always get me since I don't use them often enough for them to stick.
- pyre 15y ago[ ] is easy. It's just the 'test' command.[1] % which \[ /usr/bin/[ All of the other syntax is shell-specific (run via built-ins), so that can vary, and be a little more obtuse. [1] Albiet with some minor differences: % if [ -d /tmp ]; then echo "TRUE"; fi TRUE % if test -d /tmp ]; then echo "TRUE"; fi test: too many arguments % if test -d /tmp; then echo "TRUE"; fi TRUE % diff /usr/bin/{test,\[} Binary files /usr/bin/test and /usr/bin/[ differ % man \[ No manual entry for [
- ori_b 15y agoYes. rc has less of it, fewer edge cases, etc. Even though it still has lists implemented sanely, a full set of redirects, etc: $ 9 man rc | wc -l 496 $ man bash | wc -l 4890 Fewer interactive features as well, unfortunately. But it's small enough to keep in your head, and I find that makes it far more pleasant to use.