This is weird question but I want to know how to change message coming on terminal For Eg-
vikram@vikram-Studio-XPS-1645:~$ cat seg.c
#include<stdio.h>
void main()
{
int* p=9;
printf("%x",*p);
}
vikram@vikram-Studio-XPS-1645:~$ ./a.out
Segmentation fault
I want to change message “Segmentation fault” to something else .. like “Pointer failure”.
There is no specific purpose behind this, I just want to explore power of open source.
I try to grep in Linux Kernel source code –
vikram@vikram-Studio-XPS-1645:~$ cd linux-3.0.1/
vikram@vikram-Studio-XPS-1645:~/linux-3.0.1$ grep -r "Segmentation fault" *
Documentation/s390/Debugging390.txt:Program terminated with signal 11, Segmentation fault.
Documentation/virtual/uml/UserModeLinux-HOWTO.txt: Program received signal SIGSEGV, Segmentation fault.
vikram@vikram-Studio-XPS-1645:~/linux-3.0.1$
As the massage come, it should be somewhere in my system.
I think, I am searching at wrong place.
Thanks in advance.
As Mat commented, the message is coming from your shell.
Since your shell is probably free software (probably bash, but you could also use some others, I like zsh) you might take time to patch it accordingly.
But I believe you should not do that, because otherwise you won’t be able to explain what your system happens to do. For instance, if your modified shell outputs “
Pointer failure“, nobody would understand a question here which mentions that.It seems much simpler to learn the usual things in Linux…