File Name: mtype
#include stdio.h
#include stdlib.h
int main(int argc, char *argv[])
{
FILE *fp;
char ch;
if((fp = fopen(argv[ 1 ],"r"))==NULL) {
printf("Error: %s Cannot open file.\n",argv[1]);
exit(1);
}
while((ch = fgetc( fp )) != EOF) {
printf("%c", ch);
}
fclose(fp);
return 0;
}
I can remember back in the days of ms-dos that if you used the type command on a executable file it scrambled the text of the dos prompt. if you compile this C script and copy it to the directory called “/bin” you can use it as a command. use the command to dump some executable file and the bug really fucks up the shell font of Linux.