this post was submitted on 22 Oct 2025
96 points (100.0% liked)

Programming

23417 readers
177 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

In my decade-plus of maintaining my dotfiles, I’ve written a lot of little shell scripts. Here’s a big list of my personal favorites.

  • Evan Hahn
top 8 comments
sorted by: hot top controversial new old
[–] sznowicki@lemmy.world 14 points 2 weeks ago (2 children)
[–] ITGuyLevi@programming.dev 8 points 2 weeks ago (1 children)

Hmm... I remember seeing this going back long before 2019 and it definitely wasn't in Russian. Great read though, I can never start reading it without finishing it.

[–] sznowicki@lemmy.world 4 points 2 weeks ago

Yeah. I know it from somewhere 2010 and it was a polish bash.org or something.

[–] AnarchistArtificer@slrpnk.net 3 points 2 weeks ago

That's incredible, thank you for sharing

[–] e0qdk@reddthat.com 7 points 2 weeks ago

Here's one of mine. I got annoyed at the complexity of other command line spellcheckers I tried and replaced them with this simple python script for when I just want to check if a single word is correct:

#!/usr/bin/env python3

import sys

try:
  query = sys.argv[1].lower()
except Exception:
  print("Usage: spellcheck <word>")
  exit(1)

with open("/usr/share/dict/words") as f:
  words = f.readlines()

words = [x.strip().lower() for x in words if len(x.strip()) > 0]

if not query in words:
  print("Not in dictionary -- probably a typo")
  exit(1)
else:
  print("OK")
  exit(0)
[–] Peruvian_Skies@sh.itjust.works 6 points 2 weeks ago

Nice stash.

[–] cr1cket@sopuli.xyz 5 points 2 weeks ago* (last edited 2 weeks ago)

Some nice ideas in there.

Only the "markdownquote" thing is kinda pointless, especially since they mention it's mainly used in vim. Because vim can do exactly that already without the need of an external script. Do ctrl+v, mark the lines you want, press "I" (capital i), insert the desired thing, press esc and voila... all the selected lines are now prepended with the desired thing.

edited to make my comment sound less harsh: Nothing wrong with building your own solution if that feels better to oneself though :-)

[–] syklemil@discuss.tchncs.de 1 points 2 weeks ago

re: mksh I have snippets in my editor for shebangs++. E.g. #!<tab><enter> nets me

#!/bin/bash
set -euo pipefail

or

#!/usr/bin/env python3
# pyright: strict

etc