Live data from Hacker News

Linux Terminal Goods

diego-pacheco.blogspot.com

1–10 of 65 posts

Re: Linux Terminal Goods

#6
I prefer my terminals dumb and without much color, as the UNIX gods intended them to be.

This being said, I'm in love with `fzf`, my workflow improved markedly after scripting (on mac)

`ggvi() { git grep "$@" | fzf | sed \"s/:/ +/\" | cut -d \":\" -f 1 | gxargs -r -o vim }`

Re: Linux Terminal Goods

#7
I've just skimmed around it as someone who repeatedly need that kind of book to achieve little things in bash.

I understand bash is the basis of so many things, that its importance is just enormous.

But at the same time, I'm appalled by its syntax, idioms, etc. It's barely readable for the casual reader that I am. I wonder why nobody tries to provide a meaningful alternative. I've seen some (in python for example) but I'm kind of surprised nobody puts more money in such an effort.

For example, the "trim string" function described at the beginning of the book is horrible (although probably very clever). Why not simply provide a built in function ? That would make code so much cleaner...

I ask the question honestly, it's not a rant :-)

Re: Linux Terminal Goods

#8
post #7

I've just skimmed around it as someone who repeatedly need that kind of book to achieve little things in bash. I understand bash is the basis of so many things, that its importance is just enormous. But at the same time, I'm appalled by its syntax, idioms, etc. It's barely readable for the casual reader that I am. I wonder why nobody tries to provide a meaningful alternative. I've seen some (in python for example) bu…

Shells are made for people to interact with, not for programming. They happen to also be useful for programming, so many things have been added on over time to support that.

Shell scripting is also the least painful way to call many external programs and glue them together into something useful. Calling external programs from “real” programming languages is far more painful.

If you need a real programming language, as you mentioned, use something designed for that.

Re: Linux Terminal Goods

#9
post #7

I've just skimmed around it as someone who repeatedly need that kind of book to achieve little things in bash. I understand bash is the basis of so many things, that its importance is just enormous. But at the same time, I'm appalled by its syntax, idioms, etc. It's barely readable for the casual reader that I am. I wonder why nobody tries to provide a meaningful alternative. I've seen some (in python for example) bu…

Generally if you're trying to do something that feels like a "program" in shell script, rather than loosely gluing existing tools together, the threshold for moving it into Perl or Python should be low. Even things like trying to get the quoting right for lists of files some of which may have spaces in their names is fiddly enough to drive people to writing a "proper" program.

(or was this comment intended for https://news.ycombinator.com/item?id=21013150 )

Re: Linux Terminal Goods

#10
post #7

I've just skimmed around it as someone who repeatedly need that kind of book to achieve little things in bash. I understand bash is the basis of so many things, that its importance is just enormous. But at the same time, I'm appalled by its syntax, idioms, etc. It's barely readable for the casual reader that I am. I wonder why nobody tries to provide a meaningful alternative. I've seen some (in python for example) bu…

Its simplicity is an important part of the offering. Bash is perfect when you need predictable executions.

When you use Bash, you benefit from an entire ecosystem that also uses it. That same ecosystem is not motivated to drastically change the shell, and therefore it remains stable and predictable.

Bash typically isn't like Python or JavaScript, where certain features are introduced at a particular version and you have to constantly check for them, or not use them outright, or maintain which binary you have installed at all times. One Bash binary typically contains the same feature set as another binary.

Bash isn't the friendliest thing to work with syntactically, but it's friendlier than the alternatives in maintability and reliability.

Despite all this, on the flip side, there still are a lot of people invested in alternatives, and some have gained plenty of traction. zsh is a great example.

Post reply on HN