Re: Passing Return-Delimited Text to UNIX Sort
Re: Passing Return-Delimited Text to UNIX Sort
- Subject: Re: Passing Return-Delimited Text to UNIX Sort
- From: Christopher Stone <email@hidden>
- Date: Tue, 09 Jul 2013 00:45:31 -0500
On Jul 09, 2013, at 00:19, Rick Gordon < email@hidden> wrote: For instance, if I have compiled an unsorted list of strings, and then coerced that into a string of text lines separated by a return, how can I pass that to the UNIX sort command?
______________________________________________________________________
Hey Rick,
The shell doesn't do returns. It understands linefeeds (Unix), so you need to delimit with linefeeds in the first place or pipe through 'tr'.
set AppleScript's text item delimiters to return set _var to quoted form of (characters of "zyx" as text) do shell script "echo " & _var & " | tr '\\r' '\\n' | sort"
If you haven't already it's a good idea to read through Tech-Note TN2065:
-- Best Regards, Chris
|
_______________________________________________
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