Ok, I can bet I'm not the only one that types
ssh on the shell command, go look somewhere else what's the hostname, come back and type
ssh [hostname], which becomes
ssh ssh [hostname].
Then you just fix it, and repeat the same mistake with
ls, etc. later on. For years. Then decades.
I know one possible solution for that would be to have a hammer on my desk and use it on my hand every time I make this mistake; one day I'd have to learn.
But can anyone suggest a less painful way to solve that on bash?
I know it's possible to do that with
trap DEBUG, but.. it seems so risky.
Only thing else I can think of is defining a function for each of these commands that checks the args.