Text file end-of-line termination
Solaris provides two appropriately named utilities for translating text files from unix to dos and back again-- unix2dos and dos2unix. The dos2unix function could also be performed with standard Solaris commands:
$ cat myfile | tr -d '\015'
You could also use vi, and execute:
to strip all carriage returns from the file (use Ctrl-V Ctrl-M to generate the ^M character). Likewise, we can do the same for mac files:
$ cat myfile | tr '\015' '\012'
There are many possibilities, these are just mine. Here are a couple of examples:
The barber-pole effect
This output occurs when a file with only a new-line character EOL is displayed on a system expecting new-line and carriage return characters (ie, a windows system)
And did those feet in ancient time
Walk upon England's
And was the holy Lamb of God,
nd's pleasant pastures seen!
And did the Countenance D
Shine forth upon our clouded hills?
And was Jeru
salem builded here,
Among these dark Satanic Mills?
ng me my Bow of burning gold;
Bring me my Arrows of de
Bring me my Spear: O clouds unfold!
Bring me my C
hariot of fire!
I will not cease from Mental Fight,
shall my Sword sleep in my hand:
Till we have built Je
In England's green & pleasant Land
The ^M syndome
This occurs when a file with both new-line and carriage return characters are displayed on a system expecting new-lines only
And did those feet in ancient time^M
Walk upon England's mountains green:^M
And was the holy Lamb of God,^M
On England's pleasant pastures seen!^M
And did the Countenance Divine,^M
Shine forth upon our clouded hills?^M
And was Jerusalem builded here,^M
Among these dark Satanic Mills?^M
Bring me my Bow of burning gold;^M
Bring me my Arrows of desire:^M
Bring me my Spear: O clouds unfold!^M
Bring me my Chariot of fire!^M
I will not cease from Mental Fight,^M
Nor shall my Sword sleep in my hand:^M
Till we have built Jerusalem,^M
In England's green & pleasant Land^M