Hacker Newsnew | past | comments | ask | show | jobs | submit | more QualityReboot's commentslogin

Just out of curiosity, why awk? I've only ever used it for simple text splitting and didn't really know people did more with it. Is it a tool worth learning?


To really appreciate the need for awk, imagine writing one-liners and scripts in the late 80s where Perl or Python weren't present. The associative arrays in awk were a game changer. Of course, today there is no need to use awk for multi-line, complex scripts because Python or Perl does the job better (and both languages are more scalable). However, awk is still quite useful for one-liners. But for those developers who never use the one-liner paradigm of pipelines on the command line, this is something they don't realize they're missing.

Brian Kernighan mentions in the book that awk provides "the most bang for the programming buck of any language--one can learn much of it in 5 or 10 minutes, and typical programs are only a few lines long" [p. 116, UNIX: A History and Memoir]. Also keep in mind Larry Wall's (inventor of Perl) famous quote/signature line: "I still say awk '{print $1}' a lot."

More background on awk from Brian Kernighan in a 2015 talk on language design: https://youtu.be/Sg4U4r_AgJU?t=19m45s


Personally, I don't think that it's worth learning if you don't already know it, but the awk book is really an enjoyable read, not particularly wrong, and will show what you can do with the language so you can make a more informed decision whether to learn it.

In a way, awk, like sed, cut(1), paste(1), comm(1) is closer to the original Unix design philosophy of pipeline composition of simple, single function tools. cut, paste, and comm are simple, single function. sed is programmable, and awk even more so, but they're still optimized for being used in pipelines. Perl still has lots of options designed for pipeline usage (-p, -n, -a, -0, -F), but was always capable of doing general purpose programming, and python is primarily general purpose programming.

Personally, I've never learned sed, cut, paste, or comm; the only traditional text processing tools I use are sort & uniq. I know awk, but the one time I wanted to use it in the last 5 years in an official script, I was shouted down by confused youngsters. I use perl for one liners, and python for any nontrivial scripting.


It's a tool. If you ever need to slice and dice text, AWK is great. Sure, perl is great too, but I can never remember perl and stopped writing perl. I rarely use AWK by itself, it's usually with a mixture of other unix tools.

I once wrote code with curl, awk, sed, jq, xargs and in less than 30 lines implemented something that would have taken about 200 lines of go code. I did it too in less than an hour when I was told it would take a day. It was urgent and I needed the result fast.

There are different kind of hammers, different kind of nails and screws. Know your tools, use them when it's called for. You can use a wrench as a hammer, doesn't make it a great one.


Awk is great for data pipelines, not just oneliners.

For a long while I maintained a program that took the compiler output (intermediate form) from one toolchain, and converted it to another (intermediate form).

Why awk? It was faster, and more readable, than any of the alternatives, whilst being much much shorter.


Besides its obvious utility and generality (many tasks in computer science can be effectively solved by "simple text splitting" when the data is a few GB, and your data is often a few GB), it is worth learning awk just because the awk book is a masterpiece.


It's a question you have to answer yourself. I struggle to see how awk would fit into my work flow, personally, and it's not feasible to learn every cool tool. And you'd have to use it somewhat frequently or you start forgetting the syntax, unless you make Anki cards


awk is interesting because it was an early programming language (not just text processing) which made a number of convenient data structures available to people who could not program C.



https://disqus.com/home/discussion/tomwoods/ep_1186_lightnin...

Youtube-dl and awk to grep out of a YouTube channel.

If I were doing it again I would use youtube-dl -o to just print the base64, instead of "manually" renaming it to that with ls>awk:mv>sh.



It's important to clarify that the SCO Group in the Linux disputes was not the original Santa Cruz Operation, Santa Cruz Operation sold all Unix business to Caldera Systems in 2001, and it was Caldera Systems's CEO who started a bunch of lawsuits, suing everyone, Red Hat, and various Linux users, they even sued Novell for the Unix trademark, and obviously got a notorious reputation and turned SCO into a dirty world. And of course, it almost lost all cases and turned SCO as a company into an utter piece of garbage.

Seriously, what was the CEO thinking about?! I guess Caldera Systems purchased SCO and they suddenly found the days of commercial proprietary Unix were ending and the purchase was a mistake, and this is how they started its assaults.

Unlike the SCO Group, the original SCO didn't have such a bad reputation. Quite a few hackers in the Unix world worked with the original SCO. Also it used to hold a Unix conference, speakers included Linus Torvalds.


Ah, the poetry of naming a company after a hole in the ground.


I've had fantastic experience with airvpn. They're cheap, fast, reliable, and support all the configuration types you could want. I'm not affiliated with them but I'm surprised nobody here has mentioned them yet. By far the best VPN provider IMO.


And it's run by internet activists, support them, support the cause!

https://airvpn.org/mission/


Another vote for AirVPN. Good track record, happy customer for 6+ years.


I don't understand how solving a new problem that you haven't solved before is somehow development instead of research. All software is research. If someone had already solved it and built it, you could just copy their solution.

I've been doing dev work my whole life, and the only thing I can say about estimates is to underpromise and overdeliver.


BBC showing timelapse: https://youtu.be/HyzT5b0tNtk


The southern bit doesn't strike me as efficient at all. to go to a neighbouring blob, you'd have to go all the way to the central one, and then back down again.


Society seems to be settling in on global norms due to the rise of social media. The more engaged you are with it, the more you know what's cancelled and what's trending.

> Just pray you don't speak against mob or they'll cancel you.

I think the prudent strategy is to understand what's being cancelled today and make sure you're on the right side of it. It's really pretty easy to do just by reading HN.

Just know that you're always speaking to the mob and you won't get canceled. If you have views that disgust the mob, you're going to end up like RMS.

A lot of people are upset about cancel culture, but if you embrace it, it's pretty easy to exploit. You don't have to do the canceling yourself, but if you understand it, it's like a cheat sheet for being socially "right" on every hot button issue. I can fit in any liberal circle with ease because it's so predictable, and I know how to be edgy if I want. And because there's only two tribes that are pretty much opposite, I can do the same with conservatives.

You can still have all the radical opinions you want, you just can't do public stuff with them under your real identity, if you want to avoid being canceled. Maybe we'll see a resurgence of anonymous early-internet type culture, where people have aliases and keep their views disconnected from their public life. I think that works pretty well, because most activism can be done anonymously. It's not that hard to conform irl and do meaningful things under an alias online.


> If you have views that disgust the mob, you're going to end up like RMS.

Reading through those posts, is there any group in America that wouldn’t be angered by at least one of those posts?


I can think of a few: free speech advocates, libertarians, and long-time RMS supporters.

The thing I feel bad about with RMS is that he's clearly not able to read the room, which used to be considered quirky at best and unpleasant at worst, but now he finds himself unable to function at all in a society that he doesn't understand.

Most of the stuff he's saying would have been fringe in the 90s, but now it's unacceptable and worthy of exile.


There should be another word for it.

"Work", for most people, is a thing you have to do until you die or retire.

"Work", for rich people, is a hobby that you can quit whenever you want without suffering dire consequences.

Same word but totally different meanings based on your net worth.


Indeed, also most wealthy people I know don't really worry about their PTO, asking their boss if they can travel when necessary, explaining to someone why they were out of the office playing golf, etc.

Most of the wealthy people I know work plenty, but they also do it on their schedule and make it fit with their priorities.


Yeah but it's mostly about immunizations. You can still immigrate if you're disabled but have a caretaker.


No - if you are considered likely to become dependant on state or federal aid you can be denied. https://www.uscis.gov/greencard/public-charge


To play devils advocate - what's wrong with this?

I was always under the assumption that immigrants were suppose to benefit the native population. Which in this case they likely wouldn't?


Someone can be both "likely to become a public charge" under the law (which is not yet in effect because three federal courts have ruled it unconstitutional) and also of great benefit to the country.

He's not an American, but Stephen Hawking, for example, was a "public charge" whose substantial medical bills were largely covered by the NHS[1] and the cost of his 24-hour nursing care was made possible through grants.

And while Hawking is an extreme example in both the cost of his care and his ability, a determination that someone is "likely to become a public charge" can apply to just about anyone who might find themselves in need of Medicare. An otherwise healthy 20-year-old with a family history of Parkinson's or Alzheimers. Or, to get even more dystopian, an otherwise healthy 20-year-old with a genetic marker for Parkinson's or Alzheimers. The cost of long term care for these diseases is astronomical but I'm certain there are many Parkinson's and Alzheimers patients that have made substantial contributions to society.

[1] https://www.theguardian.com/commentisfree/2017/aug/18/nhs-sc... (Written by Hawking himself)

[2] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1123440/


The law saying “likely to be a public charge” is already in effect and is decades old. The recent change that is currently blocked is only about the factors being considered when making that evaluation (specifically, usage of various types of government assistance).


Hawking and other successful people would also handily qualify for visas based on achievements.


Cost, governments are not benevolent entities.


Your sponsor can sign off that you won't become a public charge and they'll become your caretaker.


That’s not quite true. You are probably thinking of the fact that when you sponsor someone for a green card you are required to promise that they will not use government assistance for x years, and if they do you will have to repay it.


Yup, that's what I meant.


What’s that, about the top 1% of disabled people?


Indeed, what should we do about the other 99%?


I've heard people in the political world talk about buying and selling email lists, which I thought was illegal, but seems to be common practice.


In the early 90's I gave something like $20 to the Sierra Club or a similar group. After a deluge in physical mail asking for donations from around the political spectrum, I never did it again. I left no forwarding address after moving either. Pretty dumb on their part, they traded all their goodwill for a short-term dollar.


Repulsive is absolutely the right word for this effect.

Edit for one more thought on this: it also gave me an appreciation for vegans and vegetarians. I was eating chicken while tripping once and really had some inner conflict over if it was ok to eat another animal. I'll never be a vegetarian, but for a brief moment I understood what all my hippie friends are on about :)


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: