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

Programming

23314 readers
712 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
you are viewing a single comment's thread
view the rest of the comments
[–] e0qdk@reddthat.com 7 points 1 week 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)