1

Once I had a file, to see the contents I used cat command, say cat filename, its content was displayed on the terminal, also automatically it typed some random characters on my terminal and enter key also got typed and then terminal prompted command not found. I was wondering whether it is possible to write commands in file and executing those commands using cat command. I am not able to get that file again and also searching is not helpful. But I am sure some one over here must know this.

1 Answer 1

3

This sounds like a file which had escape sequences that caused the terminal to read the following string as input. These days that capability tends to not be supported by terminal programs because it's a fairly obvious security issue.

One way this used to be doable was by programming the DEC "answerback" sequence, which the terminal would transmit in response to a Ctrl+E embedded in the file.

Sign up to request clarification or add additional context in comments.

9 Comments

xterm, gnome-terminal and the linux console have this "feature" up to now. I tested it by catting some large binary file. So I think this "feature" is burried inside the kernel. But what sequence exactly triggers this ... I don't know.
Still? That is bad. (But only the Linux console one is in the kernel; the others, it is part of those programs.) I could not tell you offhand what the sequence is that's triggering it; historically there were a number of possibilities for different terminals.
All terminals (even xterm & co) use the kernel for TTY handling - either in the form of "pseudo terminals" (xterm & co) or "virtual consoles". And I guess that's the culprit here.
But ptys do not have built in emulation of any kind, and this is controlled by the emulation.
Good point. So it seems the VC on one hand and xterm & Co on the other hand try to stay compatible with each other with independent code. :-)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.