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.
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<---
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.
*** This bug has been marked as a duplicate of bug 896447 ***