You are not logged in.
Sorry for the tongue in cheek subject line...
After getting a bit more comfortable with the command line and basic scripts, awk is becoming a handy tool. Do any of you have any preference between which "flavor" of awk you use? Do you actively go out of your way to install and use a certain version?
From what I've found the differences seem...subtle? Have any of you noticed where one should be ultimately used in replacement over the others?
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
Gawk (GNU awk) is just fine to learn awk, nawk maybe not so relevant. Mawk is kind of minimal and optimized for speed.
But, more importantly, let me suggest an awesome book which is one of the most delightful reads.
"The Awk Programming Language by Aho Weinberger Kernighan" , seriously, worth a read.
It should be a book for how to write technical books as well..
Some others you can find online:
- oreilly sed awk pocket reference
- effective programming gawk
also: http://www.gnu.org/software/gawk/manual/gawk.html
I think awk is awesome too, and will give great enlightenment.
Keep in mind though, when things get more difficult, maybe perl / python are good tools as well.
Awk is like ninja one-liner (perl too) or stream of consciousness "It Worked!" for me.
I say this to myself as well, I've still a lot to learn.
Offline
Thanks for the resources! Is GAWK, NAWK, MAWK, etc.. are those all "backwards compatible" with AWK? Meaning will anything written in GAWK be able to be run with the awk command? Likewise will something written with MAWK syntax be able to be run with using awk? I'm thinking about just aliasing awk to Gawk
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
The default version of awk on Debian, and so BunsenLabs, is mawk. It's missing some of the more advanced features of gawk etc but it is very fast, so at least while you're starting off, why not stick with that?
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
nawk no dice, stands for (New Awk) lol Nawk really lacks a bit
gawk - fully compatible with awk and nawk
Debian Jessie points to gawk so, you'll notice it doesn't matter if you type awk or gawk
because it will invoke gawk.
See man awk should pull up manual for gawk
or
~ ■: ls -l /usr/bin/awk
lrwxrwxrwx 1 root root 21 Jul 24 01:25 /usr/bin/awk -> /etc/alternatives/awk
you can use update-alternatives to configure default awk
Default should be gawk with maybe mawk as a second alternative.
Oh my gawk. I'm getting dizzy from all this awkful mawkery
--edit
oh john's right it is mawk I've installed gawk and configured it.
anyways its pretty easy to switch
Last edited by gako (2015-12-19 06:00:24)
Offline
nawk no dice, stands for (New Awk) lol Nawk really lacks a bit
gawk - fully compatible with awk and nawk
Debian Jessie points to gawk so, you'll notice it doesn't matter if you type awk or gawk
because it will invoke gawk.See man awk should pull up manual for gawk
or~ ■: ls -l /usr/bin/awk lrwxrwxrwx 1 root root 21 Jul 24 01:25 /usr/bin/awk -> /etc/alternatives/awk
you can use update-alternatives to configure default awk
Default should be gawk with maybe mawk as a second alternative.Oh my gawk. I'm getting dizzy from all this awkful mawkery
![]()
--edit
oh john's right it is mawk I've installed gawk and configured it.
anyways its pretty easy to switch
C'mon guys...just nawk it off already...
Sorry I couldn't resist..
Okay that's for that Gako and John. For just pretty basic commands, syntax, and functions, I'll stick with either mawk or gawk. It seems I have both installed.
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline