Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
OldAlias
Nov 2, 2013

Poopernickel posted:

just saw that HN post on awk - any goons actually shipping awk code for anything?

link? yeah but mostly quick and dirty one off scripts and nothing crucial

Adbot
ADBOT LOVES YOU

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

OldAlias posted:

link? yeah but mostly quick and dirty one off scripts and nothing crucial

https://news.ycombinator.com/item?id=17140934

main article is a link to the awk book, but the comments are kind of interesting - I didn't think awk was really used much any more

RFC2324
Jun 7, 2012

http 418

Poopernickel posted:

https://news.ycombinator.com/item?id=17140934

main article is a link to the awk book, but the comments are kind of interesting - I didn't think awk was really used much any more

every unix guy I have ever known has used awk at least a little for scripts and oneliners

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe
should i learn it?

is it better than grep+sed+shell?

Tankakern
Jul 25, 2007

it's perfect to replace grep+sed at least

pram
Jun 10, 2001
people pretty much use it for literally one purpose, and thats getting specific columns out of output or logs. of course that can be done with cut ... but awk offers extra formatting possibilities i guess

its a pretty goddamn ugly language though i wouldnt bother learning it in depth

Cybernetic Vermin
Apr 18, 2005

Poopernickel posted:

should i learn it?

is it better than grep+sed+shell?

eh… nah

awk is pretty neat, but you probably should just learn the equivalent perl idioms at that point. it is off there with sed, you can do a lot of really neat stuff beyond the super-basics that people know, but the limitations also crop up very quickly, and it just gets to be more annoying than helpful when you are as likely to run into a wall as you are to get a quick and easy solution for something

Cybernetic Vermin
Apr 18, 2005

Tankakern posted:

it's perfect to replace grep+sed at least

not true at all for sed, though you also should not learn the full extent of sed

OldAlias
Nov 2, 2013

it's useful to pick up a bit of it, if you need to parse through / mangle a bunch of logs or textfiles or some poo poo. no need for fluency, it's just a useful tool among others

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

Cybernetic Vermin posted:

eh… nah

awk is pretty neat, but you probably should just learn the equivalent perl idioms at that point. it is off there with sed, you can do a lot of really neat stuff beyond the super-basics that people know, but the limitations also crop up very quickly, and it just gets to be more annoying than helpful when you are as likely to run into a wall as you are to get a quick and easy solution for something

i'm an embedded linux guy, and our lead architect is very :spergin:, literally said "why provide Python when we've got busybox shell already", then tried to sell me on using some wack half-baked Python designed to run on microcontrollers

perl might appeal to the graybeard in him, but i doubt he'd ship it on product

Tankakern
Jul 25, 2007

sounds like you should try (g)awk then

spankmeister
Jun 15, 2008






Awk is great if you need to go just a bit beyond grep+sed because it has variables and control flow statements and printf and stuff so you can actually make small useful scripts with it.

sb hermit
Dec 13, 2016





if I can fit what I need in one simple awk command then I use awk

Otherwise I hunker down and write it in python. All of my engineering coworkers know python so I can just hand it off with minimum explanation if I need to.

I literally do not know anyone who actually writes perl code except for myself, when I had to write a module for logwatch and to debug something in spamassassin. Nothing about my exposure to it has compelled me to learn more about it.

I took a unix sysadmin class in college awhile back and actually wrote an awk script complete with shebang and I doubt I would understand what it meant if I had to look at it again.

sb hermit
Dec 13, 2016





speaking of gnarly syntax

here is your occasional reminder that regular expressions are still a thing that software engineers refuse to learn until they absolutely have to because it looks so ugly

but once they understand it, they try to force it on everyone else

I love regular expressions but once in awhile I forget to document a complex one and it takes awhile to decode what I was trying to do

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe
regex is a write-only language, expecially PCRE regex

hifi
Jul 25, 2012

Poopernickel posted:

should i learn it?

is it better than grep+sed+shell?

just use perl

MrMoo
Sep 14, 2000

Wasn't awk used to power Splunk?

pram
Jun 10, 2001
who gives a goddamned poo poo

mrmcd
Feb 22, 2003

Pictured: The only good cop (a fictional one).

I have met two of the letters of awk.

Whelp that's my Linux story thanks for listening.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

mrmcd posted:

I have met two of the letters of awk.

Whelp that's my Linux story thanks for listening.

I think you mean Bell Labs/Linux, or as I’ve taken to calling it lately, Bell Labs + Linux

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe
I think you mean GNU/Unix, as I’ve taken to calling it lately, GNU + Unix

Poopernickel
Oct 28, 2005

electricity bad
Fun Shoe

mrmcd posted:

I have met two of the letters of awk.

Whelp that's my Linux story thanks for listening.

Like, literally met the letters Sesame Street style

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Poopernickel posted:

just saw that HN post on awk - any goons actually shipping awk code for anything?
awk is for working, not shipping

TimWinter
Mar 30, 2015

https://timsthebomb.com

Poopernickel posted:

should i learn it?

Yes.

The real question is "when", and that's not until you have to fix someone else's awk one liner and can't figure out how to replace the the entire line with grep|cut. One day sooner and you'll find opportunities to proliferate technical debt by solving problems with a dead, esoteric language, inflicting its knowledge on others.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
despite starting my UNIX experience with SVR3 and V7 (well, MINIX) I’ve managed to entirely avoid awk

and not by using Perl, either

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
by the way, did you know you can make diff spit out a stream of ed commands to transform one of its arguments into the other?

yeah, imagine learning this and then building tooling atop it

FlapYoJacks
Feb 12, 2009
awk is cool and good.

pseudorandom name
May 6, 2007

eschaton posted:

by the way, did you know you can make diff spit out a stream of ed commands to transform one of its arguments into the other?

yeah, imagine learning this and then building tooling atop it

yeah, this came up in the secfuck thread recently

POSIX diff/patch have an ed mode, POSIX ed has a command to run arbitrary shell code, it is two great tastes that taste great together!

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull
i wrote an awk script once
i regretted it after i learned perl
that's my story

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
check out the manning book listed near the top of that hackernews thread, it focuses on perl as a pipe command in gory detail

Gazpacho fucked around with this message at 08:05 on May 26, 2018

Progressive JPEG
Feb 19, 2003

I've never written an awk script that wasn't single use

mrmcd
Feb 22, 2003

Pictured: The only good cop (a fictional one).

Poopernickel posted:

Like, literally met the letters Sesame Street style

Yeah, one of them is a real Aho.

brand engager
Mar 23, 2011

Have any of you used fedora on a pi3 before? I put the fc28 server image on mine and it's way slower than raspbian, but I cant figure out why. I don't see anything in the background eating up cpu time or IO.

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull
total guess: with an arm soc there's a chance you need a special driver to do dynamic clock frequency management, so it might just be stuck at the lowest power saving clock freq or something

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

i've got a pi 2 with cent 7 on it and i saw the same thing. my java server used to start slowly but acceptably on rasbian, now it takes forever

e: the cpu thing might be involved? lscpu says it maxes out at 700mhz but the specs say it should be 900...

carry on then fucked around with this message at 02:34 on May 29, 2018

OldAlias
Nov 2, 2013

fedora is more suitable as a desktop anyways, 6month release is annoying and you might have to fiddle with selinux a bit (not a real problem tho)

OldAlias fucked around with this message at 03:03 on May 29, 2018

Mr.Radar
Nov 5, 2005

You guys aren't going to believe this, but that guy is our games teacher.

brand engager posted:

Have any of you used fedora on a pi3 before? I put the fc28 server image on mine and it's way slower than raspbian, but I cant figure out why. I don't see anything in the background eating up cpu time or IO.

Raspbian includes some custom patches to use the Raspberry Pi's hardware features (like the DMA engine) to accelerate some general desktop graphics processing. If Fedora doesn't include those patches that could explain the difference in performance.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
huh ecryptfs is real good and easy to set up, cant believe i didnt do this sooner

started with just a encrypted area in Private, then moving directories into there and symlinking those to the "real" directories, like 'mv .thunderbird Private/thunderbird; ln -s Private/thunderbird .thunderbird' and now realizing i may as well just encrypt my whole home directory

sb hermit
Dec 13, 2016





Lysidas posted:

huh ecryptfs is real good and easy to set up, cant believe i didnt do this sooner

started with just a encrypted area in Private, then moving directories into there and symlinking those to the "real" directories, like 'mv .thunderbird Private/thunderbird; ln -s Private/thunderbird .thunderbird' and now realizing i may as well just encrypt my whole home directory

two things about ecryptfs to know

you should backup your data OR backup your ecryptfs metadata, because if that’s toast, then you’re toast

long and weird filenames do not work in ecryptfs. I have been bit by that a few times in my life but that was because of coworkers who wanted to turn the entire sentence of a document into the document’s filename and then svn complained when I tried to update

Adbot
ADBOT LOVES YOU

sb hermit
Dec 13, 2016





ubuntu is, for whatever reason, removing ecryptfs from the default install

but I think enough people like it that it will never be impossible to keep using it... it just adds some inertia for new users for ecryptfs

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply