simontatham,
@simontatham@hachyderm.io avatar

I just made a command-line typo: 'locat' in place of 'locate'.

Ubuntu's command-not-found package offered me 'lolcat' as a higher-ranked preference than what I actually intended.

The Internet has won.

kfdm,
@kfdm@social.tsun.co avatar

@simontatham I don’t have an ubuntu machine at the moment, but I’m guessing it’s this ?

https://github.com/busyloop/lolcat

Probably not useful ever, but it’s good to see people having fun from time to time XD

simontatham,
@simontatham@hachyderm.io avatar

@kfdm yes, I think you're right. command-not-found offers me two instances of 'lolcat', one from a .deb and one from a snap, but as far as I can see, both of them are the thing you link to.

bscloutier,
@bscloutier@hachyderm.io avatar

@simontatham Nice. Just rode through the eclipse out here.

I recently added the 'did you mean' thing to JANOS just minimizing the Levenshtein distance from built-in commands. But Ubuntu goes too far I think in finding suggestions. LOL

Actually added a strlev() function to my not-so-standard C library. I exposed that in our PHP-like scripting. Maybe it'll find a use there. Maybe should slip it in some Java class so applications might use it? Well, it is a simple calculation.

simontatham,
@simontatham@hachyderm.io avatar

@bscloutier on the other hand, sometimes command-not-found doesn't go far enough. It doesn't know shell builtins – so if I typo the 'cd' command, it'll offer me ~10 possibilities I didn't want from packages I've never heard of, and not the thing I almost certainly meant!

Or if the misspelling exists, it won't offer you options at all. Leave one s off the end of 'less', and it'll tell you that 'les' can be found by installing atm-tools, but not that you 99% surely meant 'less' instead!

bscloutier,
@bscloutier@hachyderm.io avatar

@simontatham I would check out the Ubuntu code out of curiosity but it is probably messy and poorly commented. I shouldn't make that assumption but open source hasn't impressed me yet.

In an OS though this might be the only use of a little AI. Don't know. I debated filling the command line after the error with the corrected command to be optionally then executed.

Our customers are not experienced at this level so this is an attempt to help them learn. Not so much for dealing with typos.

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