mjgardner, to programming
@mjgardner@social.sdf.org avatar

@Perl Happy 36th #birthday to the #Perl #programming language!

v1.0 then:
“Perl is kind of designed to make #awk and #sed semi-obsolete […] The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).” https://github.com/Perl/perl5/releases/tag/perl-1.0

v5.38.2 now:
“Perl is […] now used for a wide range of tasks including #SysAdmin, #WebDev, network programming, #GUI development, and more.” https://perldoc.perl.org/perlintro#What-is-Perl%3F

chmouel, to Bash

Something that served me well over the year, viewing a configuration files without the comment and the newlines with sed:

sed -e '/^#/d' -e '/^$/d' file.conf

so you can see a clean version of all the settings you have set in the file..

#unix #sed #bash #shell

visone, (edited )
@visone@fosstodon.org avatar

@chmouel

I would add this to filter out empty lines

sed -e '/^#/d' -e '/$^/d' -e '/^[[:space:]]*$/d'

#linux #shell #sed

montagnerurale, to random French

Team douleurs chroniques, en passant à Lidl, j'ai vu qu'ils avaient des tas de coussins, tapis, manchons chauffants à des prix relativement modiques
#fibromyalgie
#DouleursChroniques
#SED

otheorange_tag, to random
@otheorange_tag@mstdn.social avatar

Question for you young whippersnappers, is #YAML at least as much a language as #SED? Does it have some kind of stdin/stdout? looping? Trying to figure out what the next (21st) language to write a gui cloud app calculator in (yes as a matter of fact this DOES mean I did this in SED)

linuxgal, to linux
@linuxgal@techhub.social avatar

I use my #Linux Jedi light saber (#Vim) to make a #sed script to remove links to the #Mastodon posts I wanna keep. Clock is ticking on everything else. #C42

j9t, to random
@j9t@mas.to avatar

https://webglossary.info/ is based on a book (“The Web Development Glossary”). Though both book and website use Markdown, I had to write a script that converts everything so that the book can fuel the site. (This works, and automated book–site conversion is pretty cool!)

Working on that script has been weird, some peers suggested to use Node instead, but I—kind of really liked writing it, and enjoyed working quite a bit with #sed!

(Is it just me, or are shell scripts really fun?)

erlendaasland, to tetris

Thanks, @vstinner for introducing me to sed tetris: https://github.com/uuner/sedtris

#sed #tetris #obfuscatedcode

gnemmi, to linux
@gnemmi@mastodon.sdf.org avatar

Im not sure I ever shared this link in here .. but since I always find myself coming back to it, I'll go ahead and share it anyway.

This is the most helpful resource on #sed that I've ever found!

Thank you Mr. Bruce Barnett! 🤗

https://www.grymoire.com/Unix/Sed.html

#RUNBSD #BSD #Linux

governa, to linux
@governa@fosstodon.org avatar

15 #Sed Command Tips for #Linux System Administration Tasks 🐧

https://www.tecmint.com/linux-sed-command-tips-tricks/

YesIKnowIT, to linux
@YesIKnowIT@mastodon.social avatar

Centering text on 80 columns with stars:
sed -E ':x
s/^.{,80}$/&/
s/^.{,80}$/&
/
tx
' file

#Shell #Sed #Linux

YesIKnowIT, to linux
@YesIKnowIT@mastodon.social avatar

Right-align text on 80 columns:
sed -E ':a /.{80}/!{s/^/ /;ba}' file

#Shell #Sed #Linux

tivasyk, to Bash
@tivasyk@mastodon.social avatar

through all of my sysadmin experience i've been using #sed and avoiding #awk… for some reason. scratch that: for no good reason.

awk is to sed what python is to brainfuck.

the awk programs are a lot more easy to compose and modify, flexible and readable. and there's a brilliant book by the authors — now awailable for a free read from archive.org!

in retrospect, i can't see any tasks that i should have done with sed instead of #bash / awk.

linuxgal, to random
@linuxgal@techhub.social avatar

Morse code with #Sed

#!/bin/sed -rf
s/./\U&/
s/$/\nA.-B-...C-.-.D-..E.F..-.G--.H....I..J.---K-.-L.-..M--N-.O---P.--.Q--.-R.-.S...T-U..-V...-W.--X-..-Y-.--Z--../
:a
s/([A-Z])([^\n]
\n.\1([-.]+))/\3 \2/
ta
s/\n.
//

#XF

YesIKnowIT, to linux
@YesIKnowIT@mastodon.social avatar

Right-align text on 80 columns:
sed -E ':a /.{80}/!{s/^/ /;ba}' file

#Shell #Sed #Linux

jacobydave, to random

I use sed and awk enough to know I should use them, but not enough to know, necessarily, whether it's sed or awk I need at any specific instance.

mjgardner,
@mjgardner@social.sdf.org avatar

@jacobydave #awk when your data has records (lines) and fields (columns).

#sed when it doesn’t.

Combine to taste.

And when you get tired of smushing everything through text pipes or cross-platform differences forcing portable code down to the least-common denominator of features, do what @cestith said and use #Perl: https://mastodon.social/@cestith/111857559756385921

tripleo, to random
@tripleo@fosstodon.org avatar

All you nutcases still using , what's actually wrong with it?

aka What are the sharp edges?

mjgardner,
@mjgardner@social.sdf.org avatar

@tripleo I would also be remiss not to mention #Perl's included perltrap manual page, which notes both the strict and warnings pragmas and also has nice lists of things for those coming from other #programming languages and tools like #AWK, #C and #CPlusPlus, #JavaScript, #sed, and #shell.

https://perldoc.perl.org/perltrap

ChristosArgyrop, to php

I think I am 50% done finding a quadrafecta : a simultaneous hit piece against & .

This one only manages to trash talk and , so it has some ways to go.

https://stefanoborini.com/why-r-is-the-new-perl/

PS 1Gotta admit that the point about the object systems in R is somewhat spot on
PS 2 gets a dishonorable mention
PS3 I will continue to find ways to continue using all 4 of the aforementioned languages, as they are all performant and deliver in complementary ways.

mjgardner,
@mjgardner@social.sdf.org avatar

@Edwardsmoon @ChristosArgyrop @BobOHara @bduncan Yes, #Perl deliberately borrows familiar things from #Unix culture, including #C, #shell, #sed, and #awk. The goal isn’t necessarily to replace them, but to remove friction when combining their capabilities.

@randalschwartz's Perl solutions to #Usenet Unix questions usually demonstrated such reductions.

mjgardner,
@mjgardner@social.sdf.org avatar

@ChristosArgyrop @BobOHara By "happily derivative," Larry meant that #Perl intentionally resembles other languages and tools.

In context, he was responding in 1992 (Perl's current version was 4.035) to @bduncan whinging, “It's sorta like #sed, but not. It's sorta like #awk, but not.” https://groups.google.com/g/comp.unix.shell/c/J8fGo0oGUCk/m/LhF4pSEaOMwJ

mjgardner,
@mjgardner@social.sdf.org avatar

@ChristosArgyrop @Edwardsmoon @BobOHara So… fashion and received wisdom traced back to the turn-of-the-century boom in shitty #Perl, supported by the belief that they're protected from building a shitty melange of #shell, #sed, #awk, #Python, and #Rstats?

kelidanovus, to linux
@kelidanovus@hachyderm.io avatar

Folks on stack exchange will say “oh it’s real simple using sed“ and then post the most arcane line of undecipherable Deep Magic you’ve ever seen.

xdydx,
@xdydx@mastodon.social avatar

@kelidanovus
I used of my own volition this week and the box is still not smoking! :)

Wuzzy, to random German
@Wuzzy@cyberplace.social avatar

#Lügen der #Geschichte:

Walter Ulbricht (#SED), 15.6.1961: »Niemand hat die Absicht, eine #Mauer zu errichten.«

Bernd Baumann (#AfD), 21.1.2024: »Keiner will deutsche Staatsbürger #abschieben

#Deutschland #Deportation #DDR #NieWieder

Wuzzy,
@Wuzzy@cyberplace.social avatar

The previous toot in :

of :

Walter Ulbricht (), 15/6/1961: “Nobody intends to build a wall [the Berlin Wall].”

Bernd Baumann (), 21/1/2024: “Nobody wants to deport German citizens.”

sergio_101, to ChatGPT

for like more than 30 years, i have kinda skirted writing serious #ShellScripts, getting good with #awk and #sed , and getting really good with #LaTeX because it usually meant a TON of digging through old documentation and piecing things together. Recently, i just started asking #chatgpt things like:

How do I flip through a directory of a bazillion zip files, uncompress each one, put the contents on my NAS, and then move those zip files somewhere else for safekeeping?

and learn from the answer

juandesant, to random
@juandesant@astrodon.social avatar

I tend to follow the logic of awk better than the one of sed (not being a vi enthusiast), but it is good to see when one might be better than the other:

https://www.linuxjournal.com/content/text-manipulation-linux-awk-vs-sed

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • anitta
  • magazineikmin
  • InstantRegret
  • tester
  • tacticalgear
  • ethstaker
  • normalnudes
  • cisconetworking
  • cubers
  • Durango
  • Leos
  • provamag3
  • modclub
  • JUstTest
  • All magazines