• 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: linebreak in a shell script; was Re: What's wrong with this call to zip?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linebreak in a shell script; was Re: What's wrong with this call to zip?


  • Subject: Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
  • From: Philip Aker <email@hidden>
  • Date: Thu, 28 Feb 2008 18:03:00 -0800

On 08-02-28, at 15:57, Shane Stanley wrote:

set x to "blah" & return & linefeed & "blah"
count of characters of x --> 9
character 5 of x --> in Script Debugger, "\r\n"
id of character 5 of x --> {13, 10}
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {linefeed}
count of text items of x --> 1
set AppleScript's text item delimiters to oldDelims

(The result is the same if you use ASCII character 10 instead of the built-in linefeed.)

Bugginess reproducible in Script Editor:

set x to ("blah" as Unicode text) & (return as Unicode text) & (linefeed as Unicode text) & "blah"
set scount to count of characters of x
set chr5 to character 5 of x
set id5 to id of character 5 of x
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {linefeed}
set ccount to count of text items of x
set AppleScript's text item delimiters to oldDelims
{scount, chr5, id5, ccount}

--> {9, "
", {13, 10}, 1}


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: linebreak in a shell script; was Re: What's wrong with this call to zip? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
  • Next by Date: Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
  • Previous by thread: Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
  • Next by thread: Re: linebreak in a shell script; was Re: What's wrong with this call to zip?
  • Index(es):
    • Date
    • Thread