#awk — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #awk, aggregated by home.social.
-
I'm confused…I use
$ sudo freebsd-update fetch install
occasionally to upgrade to the latest patch release, and every item in `beadm list` had RELEASE in it. So my #awk nuked all the 14.3 except the most recent 14.3(p16) just in case:
14.3-RELEASE-p3_2025-10-09_101845
14.3-RELEASE-p4_2025-11-23_220745
14.3-RELEASE-p5_2025-12-17_103352
14.3-RELEASE-p7_2026-02-17_161940
14.3-RELEASE-p8_2026-02-25_182923
14.3-RELEASE-p9_2026-04-21_152417
14.3-RELEASE-p11_2026-04-29_145359
14.3-RELEASE-p12_2026-05-04_071612
14.3-RELEASE-p13_2026-05-21_064046
14.3-RELEASE-p14_2026-06-09_213408
14.3-RELEASE-p15_2026-06-30_153803Are you using freebsd-update in some different way that results in non-RELEASE boot environments/snapshots?
-
I'm confused…I use
$ sudo freebsd-update fetch install
occasionally to upgrade to the latest patch release, and every item in `beadm list` had RELEASE in it. So my #awk nuked all the 14.3 except the most recent 14.3(p16) just in case:
14.3-RELEASE-p3_2025-10-09_101845
14.3-RELEASE-p4_2025-11-23_220745
14.3-RELEASE-p5_2025-12-17_103352
14.3-RELEASE-p7_2026-02-17_161940
14.3-RELEASE-p8_2026-02-25_182923
14.3-RELEASE-p9_2026-04-21_152417
14.3-RELEASE-p11_2026-04-29_145359
14.3-RELEASE-p12_2026-05-04_071612
14.3-RELEASE-p13_2026-05-21_064046
14.3-RELEASE-p14_2026-06-09_213408
14.3-RELEASE-p15_2026-06-30_153803Are you using freebsd-update in some different way that results in non-RELEASE boot environments/snapshots?
-
Nothing like a little
$ beadm list | awk '/^14.3/ && !/14.3.*p16/{print $1}' | while read ds ; do echo $ds; yes | echo sudo beadm delete $ds ; done
to let #awk choose the relevant unused boot-environments and nuke them (and their associated datasets). Removed the "echo" once it looked good, and ran for real, freeing ~15GB here. 👍
-
Nothing like a little
$ beadm list | awk '/^14.3/ && !/14.3.*p16/{print $1}' | while read ds ; do echo $ds; yes | echo sudo beadm delete $ds ; done
to let #awk choose the relevant unused boot-environments and nuke them (and their associated datasets). Removed the "echo" once it looked good, and ran for real, freeing ~15GB here. 👍
-
Stars and Cartesian coordinates printed in nice columns with #awk
awk -F, '{printf "%-25s %8.3f %8.3f %8.3f\n", $1, $2, $3, $4}' hipparcos.csv
-
Stars and Cartesian coordinates printed in nice columns with #awk
awk -F, '{printf "%-25s %8.3f %8.3f %8.3f\n", $1, $2, $3, $4}' hipparcos.csv
-
Combinations of r elements chosen from a pool of n elements with #awk
BEGIN {
for (i=1; i <= r; i++) {
A[i] = i
if (i < r ) printf i OFS
else print i}
while (A[1] < n - r + 1) {
for (i = r; i >= 1; i--) {
if (A[i] < n - r + i) {
A[i]++
p = i
break}}
for (i = p + 1; i <= r; i++) A[i] = A[i - 1] + 1
for (i=1; i <= r; i++) {
if (i < r) printf A[i] OFS
else print A[i]}}
exit} -
Combinations of r elements chosen from a pool of n elements with #awk
BEGIN {
for (i=1; i <= r; i++) {
A[i] = i
if (i < r ) printf i OFS
else print i}
while (A[1] < n - r + 1) {
for (i = r; i >= 1; i--) {
if (A[i] < n - r + i) {
A[i]++
p = i
break}}
for (i = p + 1; i <= r; i++) A[i] = A[i - 1] + 1
for (i=1; i <= r; i++) {
if (i < r) printf A[i] OFS
else print A[i]}}
exit} -
somebody please help stop me.
I have two toy-project ideas.
They require using JavaScript. One might even involve PHP (though I might be able to do it as a cgi-bin in #awk instead)
Send help. 😖
-
somebody please help stop me.
I have two toy-project ideas.
They require using JavaScript. One might even involve PHP (though I might be able to do it as a cgi-bin in #awk instead)
Send help. 😖
-
It may depend on your personal preferences, but the base system already gives you enough to do Unix-as-IDE¹
• tmux
• vi/ed/mg to edit
• clang to compile
• make(1) for building/dependencies
• rcs/cvs for version-control
• a shell (whether you prefer sh/ksh/csh) with standard file-management commands (mv/cp/rm/cd/ls/cat/less/…)
• standard POSIX tools (sed/awk/grep/…)
• man-pagesYou can easily swap out any of those components you don't like. Prefer editing with Vim/Neovim or Emacs? Go for it. Prefer GCC or tcc to compile your C? Just a pkg_add away. Want git, got, subversion, fossil, or jujutsu? Same deal. More of a zsh/fish/bash sort of person or prefer ripgrep or Silver Searcher, or GNU #awk or mawk? Again, swap in what you prefer.
For my own C development, I use vi/vim/ed for editing, and git for version-control, but generally stick with the other base-system options.
-
It may depend on your personal preferences, but the base system already gives you enough to do Unix-as-IDE¹
• tmux
• vi/ed/mg to edit
• clang to compile
• make(1) for building/dependencies
• rcs/cvs for version-control
• a shell (whether you prefer sh/ksh/csh) with standard file-management commands (mv/cp/rm/cd/ls/cat/less/…)
• standard POSIX tools (sed/awk/grep/…)
• man-pagesYou can easily swap out any of those components you don't like. Prefer editing with Vim/Neovim or Emacs? Go for it. Prefer GCC or tcc to compile your C? Just a pkg_add away. Want git, got, subversion, fossil, or jujutsu? Same deal. More of a zsh/fish/bash sort of person or prefer ripgrep or Silver Searcher, or GNU #awk or mawk? Again, swap in what you prefer.
For my own C development, I use vi/vim/ed for editing, and git for version-control, but generally stick with the other base-system options.
-
Allocating hostel beds is like choosing seats at the tables at our wedding all over again, every single year...
Has anyone written a constraint solver for this in #awk I could use??
-
Allocating hostel beds is like choosing seats at the tables at our wedding all over again, every single year...
Has anyone written a constraint solver for this in #awk I could use??
-
Основатель движения мейкеров Дейл Догерти расспросил Майю и Свету об их проектах на нашем кружке электроники
Я писал в предыдущих постах, что наш митап по верилогу пригласили на мероприятие торговой палаты города Маунтин-Вью, Калифорния. И вот мероприятие состоялось. Ну, как я уже написал в заголовке, на наш стенд зашел Дейл Догерти, основатель журнала самоделкиных Make Magazine и выставок Maker Faire. Дейл расспросил Майю и Свету почему у них возник интерес к проектам с микросхемами малой степени интеграции.
https://habr.com/ru/articles/1065220/
#cmos_4000 #maker_faire #make_magazine #awk #sed #oreilly #SystemVerilog #verilog_meetup #hacker_dojo #mountain_view
-
A Mercator map claimed to divide humanity into two equal geographic groups. My wife asked what it would look like using the Equal Earth projection--so I rebuilt it from an SVG, GeoNames population data, awk, a spreadsheet, and a little CSS. The highlighted countries contain 49.65% of the listed world population.
https://salemdata.net/johnpress/?p=1113
#Cartography #EqualEarth #Mercator #DataVisualization #SVG #OpenData #Linux #awk
-
A Mercator map claimed to divide humanity into two equal geographic groups. My wife asked what it would look like using the Equal Earth projection--so I rebuilt it from an SVG, GeoNames population data, awk, a spreadsheet, and a little CSS. The highlighted countries contain 49.65% of the listed world population.
https://salemdata.net/johnpress/?p=1113
#Cartography #EqualEarth #Mercator #DataVisualization #SVG #OpenData #Linux #awk
-
Funny, when I process a bunch of CSV files with #awk, it never asks me to rate it in an app store, let alone proceed to complain that I can't write a review. 😉
-
Funny, when I process a bunch of CSV files with #awk, it never asks me to rate it in an app store, let alone proceed to complain that I can't write a review. 😉
-
Does anybody else here use Wordle to keep their `awk` skills fresh?
-
Does anybody else here use Wordle to keep their `awk` skills fresh?
-
I've been riding a #nerd #high since late June and here is one of the results.
https://codeberg.org/tnalpgge/cabrillo-el
While it is not directly responsible for helping me #slice and #dice our #hamradio contact logs from this past #FieldDay, it did eliminate the need for a bunch of #shell and #awk that I was using previously. Of course, by replacing some compact, proven scripts by a larger library of #Emacs #Lisp is more of an exercise in #purity than #practicality. Still, playing with #peg and formal-ish grammars was an interesting alternative to my traditional #regex approach to text processing.
It's not a thorough test suite, but it did help me catch two bugs this evening!
-
I've been riding a #nerd #high since late June and here is one of the results.
https://codeberg.org/tnalpgge/cabrillo-el
While it is not directly responsible for helping me #slice and #dice our #hamradio contact logs from this past #FieldDay, it did eliminate the need for a bunch of #shell and #awk that I was using previously. Of course, by replacing some compact, proven scripts by a larger library of #Emacs #Lisp is more of an exercise in #purity than #practicality. Still, playing with #peg and formal-ish grammars was an interesting alternative to my traditional #regex approach to text processing.
It's not a thorough test suite, but it did help me catch two bugs this evening!
-
FWIW, #awk should print from each <h4> to the first-subsequent </p> that follows the <h4>
To demonstrate, try this input
<h4> first
print this
</p> first close-p
</p> second close-p won't print
more unprinted stuff
<h4>another h4
more printed
</p> a first-subsequent close-p will print
</p> another subsequent close-p shouldn't print
more stuff not to print -
FWIW, #awk should print from each <h4> to the first-subsequent </p> that follows the <h4>
To demonstrate, try this input
<h4> first
print this
</p> first close-p
</p> second close-p won't print
more unprinted stuff
<h4>another h4
more printed
</p> a first-subsequent close-p will print
</p> another subsequent close-p shouldn't print
more stuff not to print -
#Unix / #sed / #awk / #shell ninjas,
What's the easiest way to suppress anything more than 2-3 blank lines at a time? I don't want to remove all blank lines, just excessive blank lines.
I'm coming up with a simple shell function to strip html tags, because I don't like the way terminal browsers re-flow/wrap the text when you use the
-dump|--dumpoption.The way I'd normally do it is something like:
sed 's/$/{lineend}/' |tr -d '\n' |sed -E 's/(\{lineend\}){3,}/\1\1\1/g; s/\{lineend\}/\n/g'…but I figure there's probably a more elegant way?
-
#Unix / #sed / #awk / #shell ninjas,
What's the easiest way to suppress anything more than 2-3 blank lines at a time? I don't want to remove all blank lines, just excessive blank lines.
I'm coming up with a simple shell function to strip html tags, because I don't like the way terminal browsers re-flow/wrap the text when you use the
-dump|--dumpoption.The way I'd normally do it is something like:
sed 's/$/{lineend}/' |tr -d '\n' |sed -E 's/(\{lineend\}){3,}/\1\1\1/g; s/\{lineend\}/\n/g'…but I figure there's probably a more elegant way?
-
Warum die extreme Hitze in Europa zur Abschaltung von Kernkraftwerksblöcken führt.
-
Warum die extreme Hitze in Europa zur Abschaltung von Kernkraftwerksblöcken führt.
-
Programming Languages I Have Known and Loved (and Hated) https://lowendbox.com/blog/programming-languages-i-have-known-and-loved-and-hated/ #regularexpression #Editorial&News #applescript #javascript #assembler #smalltalk #assembly #algol68 #FORTRAN #haskell #redcode #scratch #erlang #golang #PASCAL #pl/sql #prolog #python #algol #basic #batch #cobol #dbase #elisp #emacs #forth #regex #swift #bash #java #lisp #perl #PL/I #ruby #Rust #ada #apl #awk #csh #JCL #ksh #lua #PHP #rpg #SQL #go #m4 #c #r
-
Programming Languages I Have Known and Loved (and Hated) https://lowendbox.com/blog/programming-languages-i-have-known-and-loved-and-hated/ #regularexpression #Editorial&News #applescript #javascript #assembler #smalltalk #assembly #algol68 #FORTRAN #haskell #redcode #scratch #erlang #golang #PASCAL #pl/sql #prolog #python #algol #basic #batch #cobol #dbase #elisp #emacs #forth #regex #swift #bash #java #lisp #perl #PL/I #ruby #Rust #ada #apl #awk #csh #JCL #ksh #lua #PHP #rpg #SQL #go #m4 #c #r
-
Fortunately, OpenBSD also makes it fairly easy to drop a ktrace(1) on a command and then dump what it's doing:
$ ktrace -f pkg_info.ktrace -d pkg_info -Q remind
⋮
$ kdump -R -f pkg_info.ktrace | lessA little #awk on that might highlight expensive steps
$ kdump -R -f pkg_info.ktrace | awk '$1+0 > 0 && $4 == toupper($4) && $3 > 0.05 && NR>1'
(adjust the "0.05" until the result-count returns interesting-but-not-too-much data)
-
Fortunately, OpenBSD also makes it fairly easy to drop a ktrace(1) on a command and then dump what it's doing:
$ ktrace -f pkg_info.ktrace -d pkg_info -Q remind
⋮
$ kdump -R -f pkg_info.ktrace | lessA little #awk on that might highlight expensive steps
$ kdump -R -f pkg_info.ktrace | awk '$1+0 > 0 && $4 == toupper($4) && $3 > 0.05 && NR>1'
(adjust the "0.05" until the result-count returns interesting-but-not-too-much data)
-
How does one go about proposing errata for RFCs? While dumb, RFC1436¹ under "Full-Text Search Transaction" is missing "S: Accepts connection" which the other sample transactions have.
(I'm also not sure why the case differs, where tha client will "Open Connection" (uppercase C) but the server will "Accept [Cc]onnection" (case varies in RFC) which seems like a minor inconsistency)
And no, I am totally not playing with writing my gopherspace game server in #awk. Really. Okay, maybe exploring the idea just a bit…
-
Whoa, that's some #awk alphabet soup.
I'm gonna need to learn awk next, ain't I? XD
I actually started out doing it all in grep (pipe the words in the file to
grep -vixfF /usr/share/dict/words, but it was actually twice as fast to do a positive grep per input word than one big negative grep.I'm actually already removing duplicates via an awk command that I copypastad from the internet, but I'll play with your example, thanks! :D