Bug 901935 - cal (linux calendar utility) has lost newlines (\n) chars
Summary: cal (linux calendar utility) has lost newlines (\n) chars
Keywords:
Status: CLOSED DUPLICATE of bug 896447
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 18
Hardware: i386
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-20 02:48 UTC by Guido
Modified: 2013-01-26 19:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-26 19:55:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Guido 2013-01-20 02:48:59 UTC
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-22 03:04:22 UTC
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-22 03:13:33 UTC
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 19:55:02 UTC

*** 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.