Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

weird problem, command line font corrupted 2

Status
Not open for further replies.

silverspecv

Programmer
Oct 31, 2003
125
US
So I'm dorkin around at the command line following some instructions on building linux from scratch, and it tells me to create a dumy.c file with just "main(){}", then compile it, and then do a grep on the resulting a.out file to check something out about the linker.. Well, the grep came up empty, so I did a regular old CAT on the file a.out, and it garbaged my CLI font! I had to reboot to get it back. It's like all the characters got turned into their ASCII value plus 50 or something, because I could see the patterns that were supposed to be text, but it was all high ascii. I tried to search, but surprisingly "my font got garbaged" actually didn't turn up anything useful, and I can't think of a better way to describe it to search for it.. Any ideas how I could have corrected this without rebooting?
 
The problem is that the binary data sometimes contains data that when read as char do control sequences... My solution would have been to log out of the current terminal session, and login again, changing TTYs if needed. In case you haven't needed to do it yet, to change TTYs, Alt+Fx (where x is the terminal number) Crtl+Alt+Fx in XWindows. XWindows by default starts on terminals 7 and above. So, if I start the computer and log into XWin, I can get to a plain terminal (no windows) by hitting Crtl-Alt-F1, then to get to the next plain text terminal Alt-F2, and then to get back to XWindows Alt-F7.

[plug=shameless]
[/plug]
 
Any ideas how I could have corrected this without rebooting?

it happens to lot of us!! he he he... (cat file.binary --> oops :eek:P )

just issue [tt]reset[/tt] (it is a command), it will reset the fonts of your tty. It doesn't matter if you are writting with odd characters, the command is still working.

Cheers.

Chacal, Inc.
 
What? RESET?! Why that almost resembles a word. I was expecting a series of numbers and letters with a random smattering of punctuation, but thank you.. if I make that mistake again, I'll think of you!
 
silverspecv said:
I was expecting a series of numbers and letters with a random smattering of punctuation
We can do it that way, too. There's more than one way to skin a [tt]cat[/tt] (pun intended, of course).

Even if you can't tell what you're typing, run the [tt]cat[/tt] command with no arguments, then type the escape key, then the 'c' key (for Clear). That'll work on a Linux console. Do a [tt]man console_chars[/tt] to see more fun stuff you can cat to the screen, including the stuff that messed it up in the first place.


silverspecv said:
do a grep on the resulting a.out file
Nope; you were supposed to do a [tt]readelf -a[/tt] on the [tt]a.out[/tt] file, then do a [tt]grep[/tt] on the output of that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top