[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Is learning awk and sed worth it?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 33
Thread images: 7
File: 2016-01-16 17.16.42.jpg (1 MB, 1080x1920) Image search: [Google]
2016-01-16 17.16.42.jpg
1 MB, 1080x1920
Is learning awk and sed worth it?
>>
most of the useful parts of sed are based on regex
regex works literally anywhere
>>
>>52465557
sed is pretty essential for learning regex, but awk can be skipped
>>
Do people actually know Bernie Sander's viewpoints or do they just associate him with Socialism because that's what someone else told them?
>>
>>52465618
Bernie called himself a socialist
>>
File: women shouldn't vote.png (324 KB, 600x748) Image search: [Google]
women shouldn't vote.png
324 KB, 600x748
>>52465618
he's a meme candidate
not even his supporters understand his platform, they just see "FREE EVERYTHING" and think he will magically make money and prosperity appear out of thin air.
>>
>>52465634
>he's a meme candidate
Who isn't? Not anyone who has a chance of making it to the primaries, sadly.

>not even his supporters understand his platform, they just see "FREE EVERYTHING" and think he will magically make money and prosperity appear out of thin air.

I can agree with that.

Also jesus christ that fucking pic
>>
>>52465618
I think they associate him with socialism because he calls himself a socialist.
>>
>>52465634
>Free means it costs nothing!
I am officially seething with rage.
>>
File: 1451780203155.jpg (463 KB, 1000x1300) Image search: [Google]
1451780203155.jpg
463 KB, 1000x1300
>>52465634
I don't think that's true, anon. I think most people understand that one would need to raise tax rates—perhaps on capital gains—and/or decrease military spending to pay for extended social welfare programs and infrastructure spending.
>>
>>52465667
>>52465631

I guess I should rephrase. Yes, he calls himself a socialist, but do they actually know his plans? Do they really think he's going full commie?
>>
Also sed is massively useful to me on a near-daily basis but I've never touched awk. Hope this helps.
>>
>>52465701
Marx himself said that socialism is just a step towards communism.
So anyone who opposes socialists because they don't want communism isn't exactly in the wrong. To answer your question though: No, most people probably don't know much about him.
>>
>>52465557

It's like someone just compiled a list of buzzwords and strawmen, and didn't even bother to ensure that any of it actually make any sense.
>>
>>52465723
And Bakunin said something along the lines of--and I'm paraphrasing here--Marx is a fucking faggot, and communism sucks nigger dicks. Who gives a fuck what Marx himself said?
>>
>>52465723
It was actually Lenin who said that
>>52465826
The point is not necessarily incorrect—the goal of implementing a fully socialist system is to progress it to the point where it can function as a communist economy/nation.
>>
Regexes are very very worth it.
Learn them even if you don't learn sed.
>>
Yes. Awk is super good. Plus its easy
>>
awk is actually really nice and takes an hour of reading the first few sections of the manual to learn.

If you understand the concept of text files having lines, fields being separated by some character (e.g. whitespace), and regular expressions matching lines and/or records, you can understand awk.

$ awk -F ':' '$7 ~ /nologin$/ { x++ }  $7 ~ /false$/ { y++; print "we got a shitter: " $1 }  END { print "Shells: " x " nologon, " y " false" }' /etc/passwd
we got a shitter: messagebus
we got a shitter: colord
...
we got a shitter: _apt
Shells: 17 nologon, 21 false


($7 is the field in /etc/passwd that contains the shell)

/[a-z0-9]/ { ... } matches the entire line
$n ~ /[a-z0-9]/ { ... } matches the line on the field $n
BEGIN { ... } or END { ... } execute code before the first record / after the last line

Variables are scoped globally and weakly typed, arithmetic/expression syntax should be simple if you've ever programmed before, you can stick prints in wherever you want.
>>
>>52465902
>>52466060
I don't understand why you'd learn awk scripting over say Perl or Python. It seems to be just as complex but without the added benefits of a real scripting language that can do a lot of other stuff.
>>
>>52466094
>52466094

Write the equivalent program in Perl in a one-line command on a whim and I'm sure it would contain much more boilerplate and/or be written in a much more awkward way.

Only a few times of doing that would probably have wasted enough time to justify having spent the hour it takes to learn awk.

In the rare cases you're using it for more than just simple file processing, it does have functions, arrays, loops and the ability to easily spawn shell commands and process their output as well.

Also it's much ligher on dependencies if you're looking to reuse scripts: /usr/bin/mawk here is 118kb, /usr/bin/perl is 2MB plus however many MB in libraries it's loading.
>>
how do you write bash scripts without sed or awk? there's also convenience tools ack and
https://github.com/ggreer/the_silver_searcher which can be configd into vim.
>>
>>52465670
Shes making a joke, idiot
>>
Reminder that sander's wife profited off of loan fraud, banks, and colleges.
Reminder that Burlington is a shithole, and it's only positive point is that it isn't as much of a shithole as Bellows Falls.
>>
>>52465687
Social welfare spending is 70% of the US budget
>>
>>52467321
That's weird since defence is 50%.

No but seriously, healthcare for military veterans and other military things are thrown into the social budgets instead of the defence budgets to make the defence budgets looks smaller.
>>
>>52467354
You do understand the difference between discretionary and non-desxretionary budget correct?
Overall, the US blows 70% of its budget on social welfare and like services.
>>
>>52465634
And this right here is why democracy doesn't work.
>>
File: die_a_hero.png (914 KB, 747x1294) Image search: [Google]
die_a_hero.png
914 KB, 747x1294
>>52467365
>>
>>52465557
that's bullshit - thats not at all what his view points are.

a more appropriate analogy would be all teachers giving the principals kid a grade, but bernie giving him the grade he really deserves
>>
File: 4L_pCOTiKjy.jpg (827 KB, 2592x1728) Image search: [Google]
4L_pCOTiKjy.jpg
827 KB, 2592x1728
>>52465634
Women should be seen and not heard
>>
Also intressted in what i should learn. It seems like both can do the same, its just a matter of preferences.
>>
File: 1417962440343.gif (273 KB, 2192x1992) Image search: [Google]
1417962440343.gif
273 KB, 2192x1992
>>52465634
>>52465666
>he's a meme candidate
friendly reminder that amerika is a meme country and you shouldn't care
Thread replies: 33
Thread images: 7

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.