Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Linefeeds showing' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Linefeeds showing
Authored by: bluehz on Oct 22, '02 08:38:11AM

I had no problems installing nano on both my OS X box and Linux box. One problem though - when viewing files - even standard unix (e.g. not created on Mac) files opened in nano display the linefeed characters....like this:

chmod u+w $CODEREDHOSTSFILE^M
^M
^M
^M

Is there anyway to turn off the display of the linefeeds? Its rather distracting...

FYI - although it is not recommended to create aliases that mimic real cmds - I created an alias called "pico" that points to nano...I am so used to using pico that its second nature to type it -this way even if I type it I get nano instead.



[ Reply to This | # ]
Linefeeds showing
Authored by: Glanz on Oct 23, '02 08:01:28AM

Yes... there is a way! This is a problem of translating formats and is easily solved.

To fix it, type the following commands in the shell very carefully:

% echo alias m2u tr '\015' '\012' >> ~/.cshrc
% echo alias u2m tr '\015' '\012' >> ~/.cshrc

Then type:
% source ~/.cshrc

After, when working with Unix editing tools and you need to fix a Mac format file, use m2u [mac to unix] as follows
% m2u < mac-format-file > unix-friendly-file

And when you're editing a Unix file in a Mac tool and there is carriage return jibberish, use the reverse:
% u2m < unix-friendly-file > mac-format-file

The "tr" command is also helpful. See: "man tr"...



[ Reply to This | # ]