• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: breakpoints & line-endings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: breakpoints & line-endings


  • Subject: Re: breakpoints & line-endings
  • From: "Justin C. Walker" <email@hidden>
  • Date: Thu, 23 Jun 2005 17:42:05 -0700


On Jun 23, 2005, at 17:33 , Dave Camp wrote:

On Jun 23, 2005, at 5:22 PM, Justin C. Walker wrote:



On Jun 23, 2005, at 16:25 , Tim Conkling wrote:



So it seems that a common solution to the breakpoints-not-working- correctly-in-Xcode problem is to fix the line endings in source files.

I imagine that there is a way to perform this procedure on all my source files (recursively, searching in directories) with some command-line magic. I'm not very proficient in this sort of thing -- can any CLI wizards out there tell me how to fix my files?



There are probably editors out there (e.g., BBEdit) that can handle this as well, but for the GUI-challenged (which includes me :-}), there is the 'tr' command ("translate"). The simplest way to do what you want, on a single file, is:
tr "\015" "\012" < yourinputfile > youroutputfile
mv youroutputfile yourinputfile


which translates all "CR" characters in 'yourinputfile' to "NL" characters and writes the output to 'youroutputfile'; you then "rename" the latter to be the former (should you want to overwrite your original file).


I think the above will not work so good on files with DOS line endings. You'll get double CR's or double LF's depending on which way you go...

Correct.

However, 'tr' can still assist. Instead of the direct translation, you can map the "CR-NL" sequence to "NL" by using
tr -d "\015"
in place of the above. This merely deletes the "CR", leaving you with the "NL" (assuming that you don't have any '\015' characters in the file that should remain, of course :-}).


Regards,

Justin

--
Justin C. Walker, Curmudgeon at Large
Institute for General Semantics
-----------
My wife 'n kids 'n dog are gone,
I can't get Jesus on the phone,
But Ol' Milwaukee's Best is my best friend.
-----------


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >breakpoints & line-endings (From: Tim Conkling <email@hidden>)
 >Re: breakpoints & line-endings (From: "Justin C. Walker" <email@hidden>)
 >Re: breakpoints & line-endings (From: Dave Camp <email@hidden>)

  • Prev by Date: Re: breakpoints & line-endings
  • Next by Date: Re: Using XCode and en.lproj vs. English.lproj
  • Previous by thread: Re: breakpoints & line-endings
  • Next by thread: Re: breakpoints & line-endings
  • Index(es):
    • Date
    • Thread