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

Is learning awk and sed worth it?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 33
Thread images: 7

File: 2016-01-16 17.16.42.jpg (1MB, 1080x1920px) Image search: [Google]
2016-01-16 17.16.42.jpg
1MB, 1080x1920px
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 (324KB, 600x748px) Image search: [Google]
women shouldn't vote.png
324KB, 600x748px
>>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 (463KB, 1000x1300px) Image search: [Google]
1451780203155.jpg
463KB, 1000x1300px
>>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 (914KB, 747x1294px) Image search: [Google]
die_a_hero.png
914KB, 747x1294px
>>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 (827KB, 2592x1728px) Image search: [Google]
4L_pCOTiKjy.jpg
827KB, 2592x1728px
>>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 (273KB, 2192x1992px) Image search: [Google]
1417962440343.gif
273KB, 2192x1992px
>>52465634
>>52465666
>he's a meme candidate
friendly reminder that amerika is a meme country and you shouldn't care
Thread posts: 33
Thread images: 7


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.