Lunduke
News • Science & Tech
Make Computers Fun Again - Linux, UNIX, Alternative Operating Systems, Computer History, and Retro Computing. Also dad jokes.
Interested? Want to learn more about the community?
June 04, 2023

BWAHAHAHAHOUHAHA-HAHA!
I honestly did not expect ChatGPT to fail so badly! (I will not paste any of its output, Lunduke!)
It's my first time to directly use ChatGPT. I just couldn't come up with anything I want to know that it could reliably tell me. Until today when I realised I keep receiving requests by some relatives to do a bash oneliner for some text files and I'd be offloaded if I could just tell them how to do it themselves in PowerShell but it'll be long before I've learnt what I need so I have the option to ask an RTFM-level-stupid question on StackOverflow or... to test out the great deceiver. So I sacrificed the confidentiality of my name, surname and friggin' phone number to have a go. I'll paste here just my input but you'll be well able to deduce how it went:
^^^^^^^^^^^^^^^
I want to remove duplicate whitespace from a text file on a Windows 10/11 PC. On Linux with bash what I would do is:
$ cat spacious.txt | tr -s [:space:] > compact.txt
What is the easiest way to do the same on Windows without WSL?
What is the simplest PowerShell script which can produce the same result?
^^^^^^^^^^^^^^^
By whitespace I meant not only " ", but also carriage returns. Does '\s' match carriage returns as well as " "? Also, when I have duplicate carriage returns in the spacious.txt, I want to have single carriage returns in the compact.txt and not ' ' as you suggested. Please provide a suggestion taking this into account.
^^^^^^^^^^^^^^^
Sounds better, but now duplicate spaces and tabs, and carriage returns will be replaced with 1 carriage return AND a newline character. What I want is for duplicate [:space:] as defined by POSIX to be replaced with a single instance of the same kind of whitespace - spacebar, tab, return, enter or whatever other kind of whitespace there is. Two tabs should become one tab, two spacebars - one spacebar, two carriage returns - one carriage return and so on. I pointed you to the bash oneliner:
$ cat spacious.txt | tr -s [:space:] > compact.txt
and I know I should not expect you to understand what it does as you are uncapable of understanding anything due to being no more than a glorified pattern-matching algorithm, but please try to reproduce the exact same functionality in the PowerShell script you recommend. Just to be clear, in case you got confused, I didn't just ask you two things - I asked you the same thing in two different ways - first one case-by-case example to guide you and then one bash oneliner that fulfills exactly what I want, no more, no less.
^^^^^^^^^^^^^^^
Was the third and final suggestion I got by ChatGPT correct? It was the exact same as the first suggestion. Though of course the chatbot acted as if it had corrected itself.
And of course if my question had been answered on StackOverflow, ChatGPT's answer would have been correct. But I wouldn't have had to ask it the question as I've done my own research beforehand. Also the chatbot would get merit that does not belong to it.
If the problem is the way I asked, then I have to ask myself: Is programming more tedious, or prompt engineering?

Interested? Want to learn more about the community?
What else you may like…
Videos
Podcasts
Posts
Articles
Rob Pike to AI: "Just fk you. Fk you all."

After receiving an Al generated email, the programming legend (known for his work on Go, Plan 9, UNIX, & UTF-8) says, "F**k you people. Raping the planet."

More from The Lunduke Journal:
https://lunduke.com/

00:20:36
December 27, 2025
Torvalds on Vizio Ruling: Software Freedom Conservancy Looks Like "a Bunch of Incompetent Aholes"

Regarding a recent ruling, in SFC v. Vizio, Karen Sandler (SFC Director, former GNOME Director), responds to the Linux creator by saying "maybe you didn't read".

More from The Lunduke Journal:
https://lunduke.com/

00:20:10
December 26, 2025
Microsoft's Goal: Replace "Every Line of C" with Rust by 2030?

A Microsoft rep made the statement, saying the company would use Al to hit a target of "1 engineer, 1 month, 1 million lines of code". Then quickly went into damage control.

More from The Lunduke Journal:
https://lunduke.com/

00:26:05
November 22, 2023
The futility of Ad-Blockers

Ads are filling the entirety of the Web -- websites, podcasts, YouTube videos, etc. -- at an increasing rate. Prices for those ad placements are plummeting. Consumers are desperate to use ad-blockers to make the web palatable. Google (and others) are desperate to break and block ad-blockers. All of which results in... more ads and lower pay for creators.

It's a fascinatingly annoying cycle. And there's only one viable way out of it.

Looking for the Podcast RSS feed or other links? Check here:
https://lunduke.locals.com/post/4619051/lunduke-journal-link-central-tm

Give the gift of The Lunduke Journal:
https://lunduke.locals.com/post/4898317/give-the-gift-of-the-lunduke-journal

The futility of Ad-Blockers
November 21, 2023
openSUSE says "No Lunduke allowed!"

Those in power with openSUSE make it clear they will not allow me anywhere near anything related to the openSUSE project. Ever. For any reason.

Well, that settles that, then! Guess I won't be contributing to openSUSE! 🤣

Looking for the Podcast RSS feed or other links?
https://lunduke.locals.com/post/4619051/lunduke-journal-link-central-tm

Give the gift of The Lunduke Journal:
https://lunduke.locals.com/post/4898317/give-the-gift-of-the-lunduke-journal

openSUSE says "No Lunduke allowed!"
September 13, 2023
"Andreas Kling creator of Serenity OS & Ladybird Web Browser" - Lunduke’s Big Tech Show - September 13th, 2023 - Ep 044

This episode is free for all to enjoy and share.

Be sure to subscribe here at Lunduke.Locals.com to get all shows & articles (including interviews with other amazing nerds).

"Andreas Kling creator of Serenity OS & Ladybird Web Browser" - Lunduke’s Big Tech Show - September 13th, 2023 - Ep 044

After 20 years together (18 years married), I was finally able to get my lovely wife to watch Die Hard. She never had any interest because of how violent it was, but for whatever reason she was open to it this Christmas. I’m happy to report that she loved it! Yippee-ki-yay everyone. I hope you all had a wonderful Christmas, and have a happy New Year.

December 28, 2025

Someone’s in the process of building a new X server in Zig.

December 27, 2025

If you've done 6 impossible things this week, why not round it off with a trip onboard "thE grAvY trAIn" TONIGHT at 21:00 UK! (1pm Pacific/4pm Eastern)

https://erb.pw/y/tgt20251227

The Last grAvY trAIn of 2025!

#DontPanic #thEgrAvYtrAIn #TextMode
#RetroComputing #BBS #ChipTunes #TrackerMusic #ANSIArt #ASCIIArt

December 28, 2025
Reminder: The $89 Lifetime Sub deal ends after New Years Eve

Woah!

The end of December is almost here!

That means the “$89 Lifetime Lunduke Journal Subscription” deal is about to end!

When the ball drops on New Years Eve, and the calendar clocks over to 2026, the Lifetime Subscription price goes back to normal.

So, you know, grab one before that darn ball drops! (Then check out all of the Lunduke Journal Subscriber Perks.)

Because that deal is re-DONK-u-lous.

-Lunduke

Read full Article
December 21, 2025
Lunduke's Nerdy Q&A, Lifetime Sub for $89

Two quick tidbits on this glorious Sunday:

Reminder: $89 Lifetime Subscriptions

Lifetime Subscriptions to The Lunduke Journal are currently discounted to $89. For life. Which is… insane. That’s less than 1/3rd of the regular price.

Monthly and Yearly subscriptions are 50% off. Which is also pretty darned snazzy.

Submit Questions for Lunduke’s Nerdy Q&A!

On Tuesday I will be recording a long-overdue episode of “Lunduke’s Nerdy Q&A”.

Got questions you’d like asked in the show? No guarantees, but I’ll get to as many as I can!

Retro computing. Current computer news. Ridiculous hypotheticals. Any question is fair game... just make sure it’s good and nerdy.

To make it simple for me, there are two ways you can submit questions for this week’s Q&A:

  1. Add a comment to this thread on Forum.Lunduke.com.

  2. Reply to this thread over on X.

  3. Ok. I lied.  There are three ways.  You can also reply to this post, right here, on Locals.

Note: Only Lunduke Journal subscribers can access to Forum.Lunduke.com. All of the details on how to gain access are on the Lunduke Journal Subscriber Perks page.

-Lunduke

Read full Article
December 17, 2025
The FOMO of not having a Lifetime Subscription to The Lunduke Journal

Time for some Fun Lunduke Journal Facts of Fact-ly-ness!

  1. The “per-month” cost of a Lifetime Subscription to The Lunduke Journal is an asymptotic line. The longer you have that subscription, the closer it gets to $0.00.

  2. The Lifetime Subscription was first introduced 3 1/2 years ago… and is still going strong.

  3. The price of a Lifetime Subscription is currently discounted to $89. For life. That’s less than 1/3rd the normal price.

The earlier you pick one up, the quicker that asymptotic line begins approaching zero. Which is fun.

We Don’t Have Time Machines

If you think you might ever want a Lifetime Subscription, now is the time.

Imagine missing this discounted price and missing out on months of, mathematically certain, asymptotic line fun. This is one of those scenarios where Future You (tm) would want to travel back in time to tell Present You (tm) to snag a Lifetime Subscription.

Go. Grab the Lifetime Subscription for $89. That deal is good all December long.

There’s a video of me yammering about it too. Just for good measure.

You’re welcome.

-Lunduke

Read full Article
See More
Available on mobile and TV devices
google store google store app store app store
google store google store app tv store app tv store amazon store amazon store roku store roku store
Powered by Locals