With Bash version 4, it seems you can write your own command not found handler function
Code:
command_not_found_handle () {
echo "What is this thing?" >&2
return 127
}
$ notfoundcommand
What is this thing?
Edit:
Quote:
Originally Posted by webking
I want to see something like this after I hit the ENTER key.
$ wget ? <ENTER>
-bash: wget: WHATEVER not found
|
then the error message would be:
Code:
echo "-$0: $1: WHATEVER not found" >&2
Edit2:
I tend to like the trap handler method better (more possibilities), from the links given by michaelk