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

Really love this launcher. Can't recommend more!

Brazil lacks the moral authority to promote any global action. End.


It's just for the press. Can't change anything.


This defeatist take is getting old. Why don't we abolish all police and laws because we can't change anything?


Exactly my thoughts, they need an army not a A-Team unit.


It may not be quite that simple. Moving an army is no small feat, the logistics required is complicated and could be miserable to try to manage in the Amazon.

If they did manage to get a large enough military force in to catch most of the illegal miners, how much damage would be done to the Amazon just by the army getting in there?


What is better? Starting with awk or sed?


Depends on the task. Sed is typically used for search and replace and Awk is better suited for field based processing. Both these tools also have filtering features (regexp based, line number based, range, etc).

See also: When to use grep, sed, awk, perl, etc https://unix.stackexchange.com/q/303044


While each with their scope and idiosyncrasies ... they're pretty similar, at least in the pattern matching part, and both of them have a pretty internal "core" of functionalities that is easy to grasp. so the honest answer IMHO is ... "both"


If you're familiar with Vim's search/replace syntax you already know how to use "sed -e" to replace text, that's how I got into it.


Depends on your use case. I can't speak to sed, I don't know it very well. Awk is my SAK.

But I learned awk while sitting in an office at a client site. I forget the specific scenario, but I wanted to split up some files into some other files. I didn't even know awk, but grokked enough from the man page to let me do what I wanted to do. I can't even say what provoked me to turn to awk in the first place. I do know I ran into some internal open file limits, but worked around that.

If you want to tear files apart, or summarize them in some way, or push the fields around, awk is much better. sed is an editor. If I have a sed scenario, I'm more apt to just do it in vi and save the result than stitch together some pipeline with sed.

Most of my use cases are one off processing and analysis. I've never had any workflows that relied on awk or most anything like that. It was almost all throw away code, a tool on the workbench, not the production line.


Each has its uses, and there are things which are more easily achieved in one than the other.

(I have a set of scripts I use to parse NOAA's weather web page to plain text, and ended up resorting to both sed and awk in the process, and haven't yet tried to simplify that to a single script.)

Sed is usually used for simple text substitutions and manipulations.

Awk has built-in record and array concepts, as well as more standard programming constructs (loops, if/then, case/switch, printf, and external system interfaces (launching and/or reading from external programmes).

My view is that the tools overlap considerably, but also complement one another strongly.


A sed binary is usually much smaller than an awk binary, either POSIX or GNU. The memory footprint of sed will be much more compact.

However, sed has grown out of the command language used by the tty editors, and is more difficult to program (although it is Turing-complete).

The awk language implements much of the syntax of C, and it is not difficult to write a very slow and inefficient script. This inefficiency is harder to reach in sed, because it takes more effort to abuse it.

O'Reilly's book on sed and awk is available free online, both to browse and to download as a ZIP.

https://docstore.mik.ua/orelly/unix/index.htm


For those who care about copyright, that URL is not from O’Reilly; it’s a copy of a book-set that O’Reilly used to distribute via CD-ROM – with a nice user interface that used web technologies (even included a search feature). O’Reilly could make it available for free – as they’ve done so for other books such as Apache Security¹ or Using Samba² – but they still (as is their right) expect you to pay for the sed & awk book³.

¹ https://blog.ivanristic.com/2015/02/apache-security-ten-year...

² https://www.oreilly.com/openbook/samba/book/

³ https://www.oreilly.com/library/view/sed-awk/1565922255/


The old sysadmin in me says to forget both and just learn Perl.


Start with sed. It can take you a long way and it is more succint.


I'd start with AWK because it is covers more use cases


Rest in peace, Bram.


What difference does it make?


Yes. A lot. In Firefox is very useful. Using "*" + keyword in the address bar is something magical.


I'm using an iMac since late 2012 no issues whatsoever. I just had to change my OS from MacOS to Arch Linux.


No.


These numbers are only the tip of the iceberg.


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

Search: