Bug 901935 - cal (linux calendar utility) has lost newlines (\n) chars
cal (linux calendar utility) has lost newlines (\n) chars
Status: CLOSED DUPLICATE of bug 896447
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
18
i386 Linux
unspecified Severity low
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-19 21:48 EST by Guido
Modified: 2013-01-26 14:55 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-26 14:55:02 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Guido 2013-01-19 21:48:59 EST
cal @ a shell prompt gives correct display of the current month as a 2D array.

cal > month.txt produces a file with 1 line string. (no \n for each week.)

cal | less shows the same as creating a txt file.

This is an error!

Found in Fedora 18.

Absolutely reproducible.
Comment 1 tomi ollila 2013-01-21 22:04:22 EST
I've noticed the same.

output contains all non-newline characters in one line and then all the
newlines that should be between lines...


When running

script -c cal

The typescript has everything in order. I run this to see whether there
were some control characters in output. Nope

Also, 

env -i /bin/cal          -- works OK
env -i /bin/cal  | cat   -- fails.

output of the latest:
---8<-------8<------8<------8<------8<-----8<---
    January 2013    Su Mo Tu We Th Fr Sa       1  2  3  4  5 6  7  8  9 10 11 1213 14 15 16 17 18 1920 21 22 23 24 25 2627 28 29 30 31









----8<------8<------8<------8<------8<-----8<---
Comment 2 Guido 2013-01-21 22:13:33 EST
Thanks for the verification of this bug.

I, too, tried, in vain, to find some control chars with a variety of tools & never found any.

This utility used to work.

I looked at the src.rpm & noticed some comments that the entire code was rewritten in September 2012. I cannot see why. The prevous versions functioned just fine.
Comment 3 Karel Zak 2013-01-26 14:55:02 EST

*** This bug has been marked as a duplicate of bug 896447 ***

Note You need to log in before you can comment on or make changes to this bug.