Re: sed: escaping UNIX newlines -SOLVED!
Re: sed: escaping UNIX newlines -SOLVED!
- Subject: Re: sed: escaping UNIX newlines -SOLVED!
- From: Gnarlodious <email@hidden>
- Date: Sun, 18 Jan 2004 23:50:56 -0700
I found this in Technical Note 2065 - do shell script:
http://developer.apple.com/technotes/tn2002/pdf/tn2065.pdf
By default, "do shell script" transforms all the line endings in the result
to Mac-style carriage returns ( " \r" or ASCII 13 ), and removes a single
trailing line ending, if one exists.
You can suppress both of these behaviors by adding the "without altering
line endings" parameter.
Which just underscores that there's no point reading the instructions until
it doesn't work.
In any case, for shell commands like "sort" that expect UNIX newlines it's
easier to translate input instead of saying "without altering line endings"
several times:
do shell script "tr '\\r' '\\n' < " & inPOSIX & " | sort -t '>' -k4 > " &
outPOSIX
Now, if one could say "without altering line endings" as a tell block it
would be great.
-- 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.