Re: sort with do Shell script
Re: sort with do Shell script
- Subject: Re: sort with do Shell script
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 4 May 2010 16:09:47 -0400
The list is too long for the shell command line - it's the echo that's failing, before it ever gets to sort. Try this:
do shell script "sort -n -u <<EOF" & return & (unsortedList as text) & return & "EOF"
If one of the elements of the list might be "EOF", pick a different string for the sentinel...
On Tue, May 4, 2010 at 3:38 PM, Yvan KOENIG
<email@hidden> wrote:
Le 4 mai 2010 à 21:26, Yvan KOENIG a écrit :
Hello
I'm running 10.4.11.
I have a list of 12019 items
for a total of 1,273,779 characters.
Is it normal that this handler
on sortClean_nList(unsortedList)
set AppleScript's text item delimiters to (ASCII character 10)
set sortedList to paragraphs of (do shell script "echo " & quoted form of (unsortedList as string) & "| sort -n -u")
set AppleScript's text item delimiters to ""
return sortedList
end sortClean_nList
fails returning :
La commande s'est arrétée avec un état non nul
The command stopped with a non-null status.
Thanks in advance.
I tried with half the list (6135 items) and got the same error.
Yvan KOENIG (VALLAURIS, France) mardi 4 mai 2010 21:38:14
_______________________________________________
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
--
Mark J. Reed <
email@hidden>
_______________________________________________
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