cat / dev / random открывает диалог печати

373
Big_Mac

Я просто бездельничал, и в терминале моего Mac я cat /dev/randomпросто наблюдал за бесконечным потоком случайных значений. Теперь он вызвал диалоговое окно печати и хочет напечатать половину страницы текста. Предварительный просмотр слишком мал для меня, чтобы прочитать. Должен ли я распечатать это? Кто-нибудь когда-нибудь слышал об этом? Он распечатал кучу случайных символов / не символов. Почему это случилось?

1

1 ответ на вопрос

1
JakeGould

I was just messing around and in the terminal of my Mac I did cat /dev/random just to watch the endless stream of random values. It has now brought up a print dialog and it wants to print half a page of text. The preview is too small for me to read. Should I print it? Has anyone ever heard of this?

If you just emptied /dev/random into your Terminal window all that happened is it dumped piles of random data to your window. For the most part this will be innocuous gibberish, but in your case perhaps one part of the random sequence was a ctrl+P sequence that just triggered the print dialog box.

That is not unusual. That is par for the course with telling the system to dump random data. And the reality is the output of /dev/random is not intended to be viewed by a simple cat command but rather be used by a program or task that needs random data.

Which is all to say you didn’t break or damage anything, but because you outputted /dev/random in such a direct way it’s pretty much inevitable that at some point a random sequence of characters would pop up that would trigger something like this.

Похожие вопросы