Bug - All fonts in console become garbled after using cat on a gzip-compressed file?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Bug - All fonts in console become garbled after using cat on a gzip-compressed file?
Hi all,
I've dabbled with Linux in the past, but recently I'm undertaking a more comprehensive-like Linux education, and decided to install Slackware (14) on a 2008-era eee PC (1000HE to be exact, retrofitted with a 60GB OCZ SSD and 2GB RAM).
While doing a few n00b linux tutorials, I ran into a weird bug.... when I gzip compressed a text file (ex: "gzip text.txt"), and then subsequently ran a 'cat' command on that compressed file (ex. "cat text.txt.gz"), the resulting output was, understandably, garbage, but thereafter the terminal font also became garbled in a similar fashion, and while all commands ran the best I could tell, I could never get the original terminal fonts back (to readable English) until I restarted the machine...
Anyone else know about this behavior / can replicate this? Is this a weird bug, or specific to my machine, or what? This is for the most recent (as of 6/19/2013) Slackware 14, from a 32-bit DVD ISO with full installation (downloaded from the slackware site). This is while in the console, before any windows X environments / GUI.
This is not a bug. The cat command writes the file to stdout as is, which causes the shell to interpret some of output as control characters that can indeed do weird things.
To get the normal behavior back just use the command
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
Quote:
Originally Posted by digitalyuki
Thanks for the answers folks, that was quick and helpful, ever post contributed something useful and informative.
Most interesting that the binary characters are interpreted as commands in cat. I wonder what it actually does...
Thanks!
technically not as commands, but rather 'escape sequences' http://en.wikipedia.org/wiki/Escape_sequence
in short, an escape sequences are control codes that direct how the terminal displays, and errant data in binary files can be mis-interpreted as escape sequences, jazzing things up,
it gets even WORSE if you try an PRINT a binary file, trust me on this, just don't, it's ugly
technically not as commands, but rather 'escape sequences' http://en.wikipedia.org/wiki/Escape_sequence
in short, an escape sequences are control codes that direct how the terminal displays, and errant data in binary files can be mis-interpreted as escape sequences, jazzing things up,
it gets even WORSE if you try an PRINT a binary file, trust me on this, just don't, it's ugly
However, escape sequences can cause something else in the file to be interpreted as a command entered at the command line. It's easy to make a file that when catted will execute any command(s) as the user that catted the file.
However, escape sequences can cause something else in the file to be interpreted as a command entered at the command line. It's easy to make a file that when catted will execute any command(s) as the user that catted the file.
I think that depends on the terminal emulator. In the past it was to load an indent string into the terminal, then followed by requesting an ident by escape sequences.
I don't believe all terminal emulators support setting the identification string.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.