Live data from Hacker News

Text Processing in the Shell

blog.balthazar-rouberol.com

21–30 of 109 posts

Re: Text Processing in the Shell

#21

Sometimes I find it strange - in both good and bad way - that we are, in 2020, learning tools and languages designed and build in the 80s, with models and constraints of the time, with 40 years of layers of backwards compatibility, and actually going sometimes back to the 70s I am still learning tools designed around the constraints of teleprinters Sure, it’s the same on Windows side (and macOS side with their classi…

The English language is several hundreds of years old, and the ADN is several hundreds of millions years old. Everything we are based on is legacy; I do not see why it should be different in computing.

Re: Text Processing in the Shell

#23

Sometimes I find it strange - in both good and bad way - that we are, in 2020, learning tools and languages designed and build in the 80s, with models and constraints of the time, with 40 years of layers of backwards compatibility, and actually going sometimes back to the 70s I am still learning tools designed around the constraints of teleprinters Sure, it’s the same on Windows side (and macOS side with their classi…

Author here. Quick sidenote: this is chapter 2 of a book aiming at teaching the terminal and related tooling (make, jq, regular expressions, etc) to beginners and people trying to become developers.

I've been on the job for 10 years and I still use these tools daily. For example, I sent a PR yesterday that was adding a configuration entry on 150+ config files by using find, grep and sed.

I'm not pretending these are the only tools that exist, but darn are they handy sometimes, and good to have in your toolbelt.

Re: Text Processing in the Shell

#26

This is cool for English text. But once you get Unicode with various ways to represent é, whew lad. This get shitty quickly in the shell.

I would generalize that further and say that shell processing works well when your data is well-behaved wrt the thing you are trying to do. But once you start venturing into untrusted data, escaping, and yes, Unicode, things can become hairy. So basically you should always be doing some sanity checks when working in shell

Re: Text Processing in the Shell

#28

Sometimes I find it strange - in both good and bad way - that we are, in 2020, learning tools and languages designed and build in the 80s, with models and constraints of the time, with 40 years of layers of backwards compatibility, and actually going sometimes back to the 70s I am still learning tools designed around the constraints of teleprinters Sure, it’s the same on Windows side (and macOS side with their classi…

> and actually going sometimes back to the 70s

Try 1725, especially for those of us who (still) set their editors to favor 80 columns.

https://en.m.wikipedia.org/wiki/Punched_card

Re: Text Processing in the Shell

#29
post #24

Earlier quoted context omitted.

Output data as JSON, manipulate and show it with jq

not all data comes from sources that you control and have chosen how to output.

https://github.com/kellyjonbrazil/jc can come pretty handy there

Re: Text Processing in the Shell

#30
post #13
post #6

A little suggestion for the authors, they mentioned xargs, I think [GNU parallel]( https://www.gnu.org/software/parallel/ ) might work a mention too, since it is a kind of modern successor that can use many computers to run tasks.

This you have to install, xargs is everywhere. Also with the -P flag you can parallelize the most common cases.

I agree on the install part, but xargs -P still run on the same host and I was addressing the multiple hosts feature of parallel.
Post reply on HN