Pregunta

Any ideas how to save a file edited with Nano, in "Mac format"? I keep getting DOS carriage returns in my newly-saved files on my Linux box. I provided a screen shot of the bottom menu when I go to "write out" file:

M-M Mac Format??? I see that there are save options when saving but cannot figure out how to execute them

enter image description here

M-M Toggle the use of Mac format

Thanks

¿Fue útil?

Solución

The command "M-M" means "alt M". In fact, any command starting with "M" means the alt key. Some keyboards gobble up the alt key: in my case, on a Macbook Pro Retina, "esc" followed by "M" is what worked. More info here.

However, since your screenshot is showing [DOS Format] as the current selection, the key combination you really want is "alt D" (or "esc" followed by "D"). That will toggle off [DOS Format] so that you'll be saving your file with the default line-ending character (ASCII 0xA). Turning on [Mac Format] will just give you a new set of problems.

Otros consejos

Normally you neither want to save as DOS format nor in Mac format. On Linux you should prefer the Unix format, therfore:

  • enter a filename
  • press Enter

and the file will be saved with the default Unix line-endings (which is what you want on Linux):

https://unix.stackexchange.com/questions/396551/gnu-nano-2-dos-format-or-mac-format-on-linux?noredirect=1#comment707780_396551

There is no Mac format anymore. Mac OS X is UNIX.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top