You are not logged in.
Pages: 1
Hi everyone!
I was inspired by a George Carlin book to change the output of something like:
[shane@lessorlabs ~]$ OoggityBoogity
bash: OoggityBoogity: command not found
[shane@lessorlabs ~]$
I want to change the "command not found" to, well, something else. Either way, I downloaded the latest Bash's source code and changed what appear to be the necessary C coding to how I see it fit, however, I'm confused now. Wouldn't I have to remove the current Bash to build this bash, and once I do that won't executing any command be like, impossible?
Thanks in advanced, and I'm more than open to alternate methods.
P.S. I'm kinda new to Arch, so go easy on me if I'm asking something totally outlandish. I'm really sorry if I'm posting in the wrong section of the forum.
Last edited by ShaneLessor (2011-08-12 01:26:31)
Offline
bash isn't the only shell on the planet, you can use e.g. dash :-)
There's a "handle" that does X when command is not found e.g. suggest installing package ABC that provides this command etc. Put this in your .bashrc and you're done:
command_not_found_handle () { echo Nope, try again. ; }
Last edited by karol (2011-08-11 23:35:14)
Offline
This didn't seem to work, but thanks for your help anyway! Probably my own error.
Offline
This didn't seem to work, but thanks for your help anyway! Probably my own error.
After you put the above line in your .bashrc, you have to source it
. ~/.bashrc
Offline
Sorry, I just had placed it in the wrong part of the file! Thank you very much! It worked!
How would I change this for Root? Change ~/.bashrc?
Offline
How would I change this for Root? Change ~/.bashrc?
You can use e.g. /etc/bash.bashrc.local so it will affect every user, including root, or use /root/.bashrc.
Offline
Thanks a lot! This is exactly what I wanted.
Offline
Glad I could help.
Please mark the thread as solved.
Offline
Pages: 1