4 ms·
Personally I think a lot of the warts with Bash are more down to it's "language" design rather than pipes. Things like how $VARIABLES are expanded before a stat
by hnlmorg 4y ago
Personally I think a lot of the warts with Bash are more down to it's "language" design rather than pipes. Things like how $VARIABLES are expanded before a statement is compiled into a argument (which leads to spaces in $VARIABLES breaking things) are entirely fixable and quite a number of alternative Linux/UNIX shells do address those kinds of problems directly.
That all said, I'm not disagree with your point about smarter pipelines (rather than dumb byte streams) would be advantageous too.
- hsbauauvhabzb 4y agoThe very notion that $PATH is a list encoded as a colon separated string is a hack ;)
- hnlmorg 4y agoI wasn't disagreeing with your point that there are plenty of rough edges. I was just saying that a lot of common problems are really more Bashisms. Though to address your $PATH point directly, in the literal decades that I've been using Linux and UNIX systems, I can't recall a single time when I've ran into a problem with $PATH values being colon delimited. And the reason it is structured that way is again, to work around a limitation of the shells of that time (ie they didn't support arrays). Though if we are going to talk about problems with environmental variables then $PATH would be somewhere at the bottom of the list while the structure those values are stored at would be top (you think it's a pain parsing $PATH, trying parsing raw env var "structs" -- I've seen far more bugs introduced there) along with the fact that it was never intended to be secure yet that passing secrets seems to be one of it's primary use cases these days.