Discussion:
Unix line break translate on open and save?
Ken G. Brown
2008-04-28 22:00:55 UTC
Permalink
I am working with some files with Unix line endings, which I would like to be able to open and view properly then save again with Unix line endings. Currently I have Preferences/Text Files set to translate line breaks, and default set to Mac(CR).

This seems to be ok, I can view the files in the proper format but I'm unsure of all the interactions.
ie. if I edit the file and save it again, does 'Translate line breaks' save with Unix line breaks?

Is it perhaps better in general to set the Default line breaks to Unix(LF)?

Thx for any insight.

Ken G. Brown
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Patrick Woolsey
2008-04-28 23:17:35 UTC
Permalink
Post by Ken G. Brown
I am working with some files with Unix line endings, which I would like to
be able to open and view properly then save again with Unix line endings.
Currently I have Preferences/Text Files set to translate line breaks, and
default set to Mac(CR).
This seems to be ok, I can view the files in the proper format but I'm
unsure of all the interactions.
ie. if I edit the file and save it again, does 'Translate line breaks'
save with Unix line breaks?
Is it perhaps better in general to set the Default line breaks to Unix(LF)?
As a general rule, just leave "Translate Line Breaks" turned on and BBEdit
will do the right thing with existing files. :-)


in a bit more detail:

The "Default Line Breaks" option (in the Text Files prefs panel) determines
what line ending format BBEdit sets for newly-created files.

However, BBEdit will always preserve the line ending format of any existing
file you open, unless you explicitly change the format before (or while)
saving the file.


Regards,

Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com>
P.O. Box 1048, Bedford, MA 01730-1048
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
William Reveal
2008-04-28 23:20:22 UTC
Permalink
I have used BBEdit with Unix line breaks for longer than I can
remember. I have never run into an issue on the Mac - but of course,
if I am not using BBEdit to edit a text file I am using vim so I
doubt I would have run into a reason for a problem. Of course, Mac OS
X is Unix so I would think most modern Mac apps would not have a
problem with the Unix format.

Bill
Post by Ken G. Brown
I am working with some files with Unix line endings, which I would
like to be able to open and view properly then save again with Unix
line endings. Currently I have Preferences/Text Files set to
translate line breaks, and default set to Mac(CR).
This seems to be ok, I can view the files in the proper format but
I'm unsure of all the interactions.
ie. if I edit the file and save it again, does 'Translate line
breaks' save with Unix line breaks?
Is it perhaps better in general to set the Default line breaks to Unix(LF)?
Thx for any insight.
Ken G. Brown
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Errol Sayre
2008-04-28 23:41:26 UTC
Permalink
Post by Ken G. Brown
Is it perhaps better in general to set the Default line breaks to Unix(LF)?
Now that we live in the days of OS X... there's almost no need to ever
see "Mac Linebreaks" again... The only folks that will run into
problems would be folks still running an ancient version of classic
Mac OS and aren't using a decent text editor... something like
SimpleText from System 7 may have trouble with UNIX line breaks (don't
quote me on that) but even back in the System 7 days Macs knew how to
play nice with unix file servers and such...

I for one, set Unix line breaks as my default.
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Bruce Van Allen
2008-04-29 00:20:08 UTC
Permalink
Post by Errol Sayre
Post by Ken G. Brown
Is it perhaps better in general to set the Default line breaks to Unix(LF)?
Now that we live in the days of OS X... there's almost no need to
ever see "Mac Linebreaks" again... The only folks that will run into
problems would be folks still running an ancient version of classic
Mac OS and aren't using a decent text editor... something like
SimpleText from System 7 may have trouble with UNIX line breaks
(don't quote me on that) but even back in the System 7 days Macs
knew how to play nice with unix file servers and such...
I for one, set Unix line breaks as my default.
So do I, but Classic Mac linebreaks (\015 aka CR) DO show up in
exports to text files from Filemaker Pro, and when Excel saves as text
on OS X (YMMV with newest versions of those apps).

Best,

- Bruce

__bruce__van_allen__santa_cruz__ca__
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Bill Rowe
2008-04-29 02:38:11 UTC
Permalink
Post by Ken G. Brown
Is it perhaps better in general to set the Default line breaks to Unix(LF)?
This really depends on what apps you will use to the file with.
If the only app you use is BBEdit, then the default line break
doesn't matter since BBEdit will do the right thing.

If you plan open the file with another app and that is a newer
app designed to play nice in OS X then the Unix LF is probably
the best bet. OTOH, if it is an older app that needs Classic or
was changed just enough to get it to run under OS X without
using Classic, then the Mac line terminator (CR) will likely be
what you need. But this really should be the exception rather
than the general rule.
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Ken G. Brown
2008-04-29 03:37:43 UTC
Permalink
Thx for all the responses.
I will change the default to Unix(LF). Shouldn't be needing anything for Classic.
From the comments, I understand how this works better now. I mainly right now need to keep files Unix/Linux compatible.

Thx,
Ken G. Brown
Post by Ken G. Brown
Is it perhaps better in general to set the Default line breaks to Unix(LF)?
This really depends on what apps you will use to the file with. If the only app you use is BBEdit, then the default line break doesn't matter since BBEdit will do the right thing.
If you plan open the file with another app and that is a newer app designed to play nice in OS X then the Unix LF is probably the best bet. OTOH, if it is an older app that needs Classic or was changed just enough to get it to run under OS X without using Classic, then the Mac line terminator (CR) will likely be what you need. But this really should be the exception rather than the general rule.
--
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Continue reading on narkive:
Loading...