Different behavior of cat terminal commands in different versions of macOS

Hello. I'm using iMac with macOS 11.6.6 and MacBook with macOS 13.6.3 and I noticed that the behaviour of the cat command in terminal is different on theme OS, in particular, the cat -benstv file_name command produces a different result. I have a suspicion that at some point the behavior of the e flag changed, which puts $ at the end of the line, because my results differ only in this. Is it so? Has the behaviour or of the command really been changed in new versions of macOS? Look at the dollar sign at the beginning of the line, the first screenshot on macos 11, the second on macos 13

MacBook Pro 15″, macOS 13.6

Posted on Jan 23, 2024 8:56 AM

Reply
4 replies

Jan 23, 2024 6:41 PM in response to EgorDubina

Doesn't Apple use Clang as their compiler? That would certainly explain differences between the built-in and source compiled with GCC. Otherwise, have you ruled out other things that could be affecting how output is displayed - different versions of zsh between your macOS 11 and 13 instances (and are you sure the same shell is being used on both?). other customizations, oh-my-zsh plugins or .zshrc alias lines that could be affecting how cat is actually called on the command line?

Jan 23, 2024 11:15 AM in response to EgorDubina

additionally, I took the cat.c code from apple's open source (https://opensource.apple.com/source/text_cmds/text_cmds-87/cat/cat.c ), copied it from the built-in gcc compiler, and then compared the output of the compiled file and the built-in cat command and still got different conclusions. Even if the cat command has not changed, this behavior is very strange.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Different behavior of cat terminal commands in different versions of macOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.