Re: strange behaviour in search for \n
Re: strange behaviour in search for \n
- Subject: Re: strange behaviour in search for \n
- From: Gnarlodious <email@hidden>
- Date: Mon, 05 Jul 2004 08:29:02 -0600
This is good information.
Entity Nigel Smith spoke thus:
>
> On 1/7/04 20:45, "Gnarlodious" <email@hidden> wrote:
>
>> I find that that shell script do not normally change linendings to \n and
>
>> only a few commands demand \n (for example, "sort"). It's unwieldy and
>
>> superfluous.
>
Here's an example of what got Charles in a tizzy:
>
>
set macLine to ASCII character 13
>
set unixLine to ASCII character 10
>
set script1 to "echo \"hello" & macLine & "world\""
>
set script2 to "echo \"hello" & unixLine & "world\""
>
log (ASCII number of character 6 of (do shell script script1))
>
log (ASCII number of character 6 of (do shell script script1 without
>
altering line endings))
>
log (ASCII number of character 6 of (do shell script script2))
>
log (ASCII number of character 6 of (do shell script script2 without
>
altering line endings))
>
>
...gives -->
>
13
>
13
>
13
>
10
>
And I hope you can now see why -- assuming my explanation makes sense!
Thank you Nigel for taking the time to explain it thoroughly. I do use the
"returned value" for short jobs but have never run into the problem.
I retract my previous statement, it doesn't apply in this case.
-- Gnarlie
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.