mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#awk

3 posts3 participants0 posts today
Simon Forman<p>I wrote my first <a href="https://mastodon.social/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> code last night. Ooo what a cute program. I can see how it must have been a revelation in it's time.</p>
Digital Mark λ ☕️ 🕹 🙄<p>Batman gonna do some text processing on this guy.<br><a href="https://appdot.net/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a></p>
Space Hobo<p>That <a href="https://teh.entar.net/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> script is someone's fork of `guff` ("a plot(1) device") that I've carried around for a while. It takes in columns of numbers on stdin and spits out an SVG plot with reasonable defaults. Damned handy.</p>
JdeBP<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@simontatham" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>simontatham</span></a></span> </p><p>Do you run a mile from almost all <a href="https://tty0.social/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> variants? (-:</p><p>Those have an escaping deficiency (save perhaps BSD awk where -F takes a regular expression) that almost no-one seems to deal with.</p><p>Few people realize that /etc/fstab in <a href="https://tty0.social/tags/FreeBSD" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FreeBSD</span></a> is actually vis(3)-encoded, meaning that whitespace can never occur as field data, however one must unvis each field to work correctly.</p><p>There is a very obscure hint to this at the foot of the fstab(5) manual page.</p><p><a href="https://github.com/freebsd/freebsd-src/blob/main/lib/libc/gen/fstab.c#L151" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/freebsd/freebsd-src</span><span class="invisible">/blob/main/lib/libc/gen/fstab.c#L151</span></a></p><p><span class="h-card" translate="no"><a href="https://social.treehouse.systems/@ska" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>ska</span></a></span></p>
melezhik<p>See my SO answers as alternative to <a href="https://fosstodon.org/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a>/#sed using amazing <a href="https://fosstodon.org/tags/Rakulang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rakulang</span></a> regexs and Sparrow tool - <a href="https://stackoverflow.com/search?tab=newest&amp;q=Raku%2fSparrow&amp;searchOn=3" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">stackoverflow.com/search?tab=n</span><span class="invisible">ewest&amp;q=Raku%2fSparrow&amp;searchOn=3</span></a></p>
Mariette Timmer<p>Awk: Hack the planet['s text]! (Presentation) - 2023 Update</p><p><a href="https://youtube.com/watch?v=E5aQxIdjT0M&amp;si=Cz2fpA_qnFh9F9eN" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">youtube.com/watch?v=E5aQxIdjT0</span><span class="invisible">M&amp;si=Cz2fpA_qnFh9F9eN</span></a></p><p><a href="https://mastodon.nl/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a></p>
Linux Magazine<p>Looking for stats? Pete Metcalfe shows you how to quickly analyze and plot your data with just one line of Bash and tools like AWK and gnuplot<br><a href="https://www.linux-magazine.com/Issues/2025/294/Bash-Stats?utm_source=mlm" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">linux-magazine.com/Issues/2025</span><span class="invisible">/294/Bash-Stats?utm_source=mlm</span></a><br><a href="https://fosstodon.org/tags/Bash" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Bash</span></a> <a href="https://fosstodon.org/tags/tools" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tools</span></a> <a href="https://fosstodon.org/tags/AWK" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AWK</span></a> <a href="https://fosstodon.org/tags/gnuplot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>gnuplot</span></a> <a href="https://fosstodon.org/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a> <a href="https://fosstodon.org/tags/stats" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>stats</span></a> <a href="https://fosstodon.org/tags/data" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>data</span></a> <a href="https://fosstodon.org/tags/SQL" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SQL</span></a></p>
חנן כהן • Hanan Cohen<p>I am using <a href="https://tooot.im/tags/AWK" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AWK</span></a> for only one command. </p><p>ia tasks | awk -F "identifier" "{s+=(NF-1)} END {print s}"</p><p>It counts my Internet Archive tasks that are currently running.</p><p>Now that I have a new computer, I didn't want to install AWK for just one command. I asked Claude to write me the same command for PowerShell. </p><p>(ia tasks | ForEach-Object { ($_ -split "identifier").Count - 1 } | Measure-Object -Sum).Sum </p><p>Sad to say goodby to AWK. It was very useful to me three jobs ago.</p>
unixbhaskar<p>Cool !!</p><p><a href="https://fosstodon.org/tags/linuxadmin" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>linuxadmin</span></a> <a href="https://fosstodon.org/tags/perl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>perl</span></a> <a href="https://fosstodon.org/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> <a href="https://fosstodon.org/tags/opensource" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opensource</span></a> <a href="https://fosstodon.org/tags/tool" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tool</span></a> <a href="https://fosstodon.org/tags/unix" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>unix</span></a> </p><p><a href="https://metacpan.org/pod/App::a2p" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">metacpan.org/pod/App::a2p</span><span class="invisible"></span></a></p>
lj·rk<p>Maybe I'm just too tired to find a way for `podlet` to write it's output to multiple files if there are multiple files to generate. E.g., if a compose file would result in multiple quadlet `.container` files.</p><p>Fortunately, <a href="https://todon.eu/tags/AWK" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AWK</span></a> is just an amazing tool and let's me write an ultra-simple state-machine to transform podlet's output into multiple files. Use with:</p><p>```<br>podlet compose ./path/to/complex.compose | awk -f podlet_stdout_to_files.awk<br>```</p><p>The AWK script:</p><p>```<br>BEGIN { state="filename" }<br>/^# / { if (state == "filename") { filename=$2; state="unit"; } else { print "unexpected filename"; exit 1; } }<br>/^---$/ { if (state == "unit") { state="filename" } else { print "unexpected end-of-unit marker"; exit 1; } }<br> { if (state == "unit") { print $0 &gt;&gt; filename } }<br>```</p><p>Without error handling:</p><p>```<br>BEGIN { state="filename" }<br>/^# / { filename=$2; state="unit" }<br>/^---$/ { state="filename" }<br> { if (state == "unit") { print $0 &gt;&gt; filename } }<br>```</p>
Space Hobo<p><span class="h-card" translate="no"><a href="https://graphics.social/@metin" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>metin</span></a></span> I see you and raise you <a href="https://teh.entar.net/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> on a terminal: <a href="https://github.com/patsie75/awk-demo" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/patsie75/awk-demo</span><span class="invisible"></span></a></p>
Slatian<p>Hey xdg-shell-linux fedi corner :drgn: </p><p>I need some eyes on this code here: <a href="https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/147" rel="nofollow noopener" target="_blank">https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/147</a></p><p><a class="hashtag" href="https://pleroma.envs.net/tag/linux" rel="nofollow noopener" target="_blank">#linux</a> <a class="hashtag" href="https://pleroma.envs.net/tag/awk" rel="nofollow noopener" target="_blank">#awk</a> <a class="hashtag" href="https://pleroma.envs.net/tag/freedesktop" rel="nofollow noopener" target="_blank">#freedesktop</a> <a class="hashtag" href="https://pleroma.envs.net/tag/xdg" rel="nofollow noopener" target="_blank">#xdg</a> <a class="hashtag" href="https://pleroma.envs.net/tag/xdgutils" rel="nofollow noopener" target="_blank">#xdgutils</a> <a class="hashtag" href="https://pleroma.envs.net/tag/shell" rel="nofollow noopener" target="_blank">#shell</a></p>
Space Hobo<p>Hey <a href="https://teh.entar.net/tags/entr" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>entr</span></a> fans: are there any examples of a `$ENTR_STATUS_SCRIPT` script out in the wild, or any explanation for what this feature was meant to do? It seems like it could be useful, and I'm a huge fan of <a href="https://teh.entar.net/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a>, but I can't find anyone explaining what they do with it.</p>
Hacker News<p>Using Awk to find out the FBI was paying scrapers to find Torswats</p><p><a href="https://blog.freespeechextremist.com/blog/fse-vs-fbi.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.freespeechextremist.com/b</span><span class="invisible">log/fse-vs-fbi.html</span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/Awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Awk</span></a> <a href="https://mastodon.social/tags/FBI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FBI</span></a> <a href="https://mastodon.social/tags/Scrapers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Scrapers</span></a> <a href="https://mastodon.social/tags/TorSwats" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TorSwats</span></a> <a href="https://mastodon.social/tags/Cybersecurity" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Cybersecurity</span></a> <a href="https://mastodon.social/tags/FreeSpeech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FreeSpeech</span></a></p>
tiagoafpereira 🚲📷⌨️<p>On migrating from Pocket, file conversions and link rot.</p><p>Learned a few things about <a href="https://mastodon.social/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> and <a href="https://mastodon.social/tags/gawk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>gawk</span></a> and ended up picking <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> to get it done.</p><p><a href="https://tiagoafpereira.net/blog/posts/2025-06-04-migrating-from-pocket/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">tiagoafpereira.net/blog/posts/</span><span class="invisible">2025-06-04-migrating-from-pocket/</span></a></p><p><a href="https://mastodon.social/tags/pocket" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pocket</span></a> <a href="https://mastodon.social/tags/linkding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>linkding</span></a> <a href="https://mastodon.social/tags/migration" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>migration</span></a></p>
Tim Chase<p>TIL that modifying NF in <a href="https://mastodon.bsd.cafe/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> has an instant effect, so if you do</p><p>$ echo a b c | awk '{while (NF){print $(NF--)}}'</p><p>the post-decrementing removes the entry before the variable gets accessed, resulting in it printing blanks, so instead you have to access the variable before doing the post-decrement:</p><p>$ echo a b c | awk '{while (NF){print $NF; NF--}}'</p><p>to print each item in reverse.</p><p>Which seems weird given what I understand about how post-decrement is *supposed* to work.</p><p>(HT: <span class="h-card" translate="no"><a href="https://oldbytes.space/@drscriptt" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>drscriptt</span></a></span> whose <a href="https://mastodon.bsd.cafe/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> sent me down this rabbit-hole of learning)</p>
DrScriptt<p><span class="h-card" translate="no"><a href="https://mastodon.bsd.cafe/@gumnos" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>gumnos</span></a></span> That didn't quite work, but I did get it to work.</p><p>Here's what I have:</p><p>awk -F. '{for (C=NF;C; C--){printf "%s.", $C}; printf "oid."}'</p><p>NF-1 was missing a component.</p><p>I also added curly braces around the 1st printf to make it more obvious what the for loop applied to.</p><p>I wasn't aware that the for loop only applied to the very next instruction. <a href="https://oldbytes.space/tags/TIL" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TIL</span></a> <a href="https://oldbytes.space/tags/AWK" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AWK</span></a></p>
DrScriptt<p>Well I did a thing.</p><p>I created a <a href="https://oldbytes.space/tags/DNS" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>DNS</span></a> zone; .oid, on my DNS server <a href="https://oldbytes.space/tags/OIDs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>OIDs</span></a>.</p><p>I can now easily look up OID values with dig (et al.):</p><p>% dig +short txt 2.3.7.5.5.1.6.3.1.oid.</p><p>To look up OIS 1.3.6.1.5.5.7.3.2.</p><p>I also wrote a one* line shell script to make doing the lookups easier:</p><p>\dig +short txt $(echo ${1} | awk -F. '{for (C=NF; C&gt;1; C--){printf "%s.", $C}; printf "%s.oid.", $1}') | sed 's/"//g' <a href="https://oldbytes.space/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a></p><p>So I can now run:</p><p>% oidlookup 1.3.6.1.5.5.7.3.2</p><p>and get the following output:</p><p>{iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) kp(3) id-kp-clientAuth(2)}</p>
Stewart Russell<p>Exploring the Birthday paradox (inefficiently) in Bash:</p><p>for j in {1..1000};do for i in {1..23};do date +%m-%d --date="+$RANDOM days";done|awk '{a[$0]++}END{s=0;for(i in a){if(a[i]&gt;1){s=1;break}}print s}';done|sort|uniq -c</p><p>Theoretical result would be 493 0s and 507 1s. There may be modulo bias from mapping the full range of $RANDOM to days of the year. Yes, it does call GNU `date` 23,000 times ...</p><p><a href="https://xoxo.zone/tags/shell" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>shell</span></a> <a href="https://xoxo.zone/tags/bash" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bash</span></a> <a href="https://xoxo.zone/tags/linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>linux</span></a> <a href="https://xoxo.zone/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> <a href="https://xoxo.zone/tags/BirthdayParadox" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BirthdayParadox</span></a></p>
Simon Wolf<p>Since they are shutting down soon, yesterday evening I downloaded my Pocket data and, because I have weird compulsions, decided to use <a href="https://social.sgawolf.com/tags/awk" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>awk</span></a> to parse the very simple CSV file into a very simple Markdown file.</p><p>And then, because my previous, equally niche, AWK post had been oddly popular, I wrote about this new script too: <a href="https://blog.sgawolf.com/post/2025-05-22-pocket-parser" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.sgawolf.com/post/2025-05-</span><span class="invisible">22-pocket-parser</span></a></p>