Is there a method to append no space after pathname tab completion in Bourne shell?

I often need to remove some similarly named extraneous files from certain directories. Muscle memory kicks in and there have been now several times in which I've appended an * after a space when it really would have been better to not. Multiple files to be deleted I end up with rm FILES* , no sweat, but occasionally there is only one files and of course I rapidly enter rm FILE * which deletes everything in the directory, which is recoverable but unfortunate. I found that bash has a -nospace option but see nothing similar in the sh man page. Is there a method to accomplish this in the standard shell?
 
Not that I know of in Bourne shell.

Korn shell is compatible with Bourne shell, and has the "esc" character to switch into edit mode, and the "*" character (in edit mode) which will expand the wildcards for inspection.
 
Two comments, neither a direct answer to your question. I don't know how to do this in regular sh.

First suggestion: Define rm to be "rm -i", then if you by mistake have a star in the list of things to delete, you still get to confirm it.

Second suggestion: If bash has a feature you like for interactive use, just install it and use it.
 
Back
Top