日记中连续的相同行被压缩为一行

日记中连续的相同行被压缩为一行

我运行如下:

% systemd-run --user python3 -c "print(1);print(1)"
Running as unit: run-r9210c54561b84cdbaf4e741f5d2f3e57.service

我期望每行看到两个 1。但我只看到一个 1。但是当打印不同的文本时,它们工作正常。

Jan 16 21:47:35 HOSTNAME systemd[30228]: Started /usr/bin/python3 -c print(1);print(2).
Jan 16 21:47:35 HOSTNAME python3[89226]: 1
Jan 16 21:47:35 HOSTNAME python3[89226]: 2
Jan 16 21:47:35 HOSTNAME systemd[30228]: run-ra947cd73cb164f208c863731013a261d.service: Succeeded.

Jan 16 21:47:41 HOSTNAME systemd[30228]: Started /usr/bin/python3 -c print(1);print(1).
Jan 16 21:47:41 HOSTNAME python3[89282]: 1
Jan 16 21:47:41 HOSTNAME systemd[30228]: run-r3c1ec5e8581d40a09081c64fdbcc689f.service: Succeeded.

Jan 16 22:13:07 HOSTNAME systemd[30228]: Started /usr/bin/python3 -c print("\n".join("1111112111111112111111111122111111")).
Jan 16 22:13:07 HOSTNAME python3[101884]: 1
Jan 16 22:13:07 HOSTNAME python3[101884]: 2
Jan 16 22:13:07 HOSTNAME python3[101884]: 1
Jan 16 22:13:07 HOSTNAME python3[101884]: 2
Jan 16 22:13:07 HOSTNAME python3[101884]: 1
Jan 16 22:13:07 HOSTNAME python3[101884]: 2
Jan 16 22:13:07 HOSTNAME python3[101884]: 1
Jan 16 22:13:07 HOSTNAME systemd[30228]: run-r7d461874552c4ddf923d05d02328a217.service: Succeeded.

这是预期的行为吗?我在文档中找不到。有没有办法来解决这个问题?

相关内容