Re: 'sort' command-alternative?
Re: 'sort' command-alternative?
- Subject: Re: 'sort' command-alternative?
- From: bill fancher <email@hidden>
- Date: Sat, 5 Oct 2002 12:11:58 -0700
On Friday, October 4, 2002, at 03:00 PM, Shane Stanley wrote:
On 5/10/02 5:24 AM +1000, bill fancher, email@hidden, wrote:
The above doesn't address the problem noted by Randal L. Schwartz
concerning breakage when process names contain single quotes. That's
not just a Perl thing.
BTW, the following fixes the problem with single quotes. The quoted
form property is made for this sort of thing.
set text item delimiters to (ASCII character 10)
tell application "Finder" to set theList to name of processes as string
set text item delimiters to {""}
do shell script ("echo " & quoted form of theList & "| sort -f")
Is it Unicode happy (as in AS's Unicode text)?
I've been hoping some Unicode expert would answer. AFAIK sort isn't
Unicode happy, at least in the sense that it doesn't correctly
recognize a string in two different encodings, or with two different
"spellings", as being the same. But in this particular case, Finder
screws things up before sort gets a chance to.
For general Unicode happy utilities, I'd look at Tcl, Python, or Perl.
The "traditional" stuff is pre-Unicode, though there are doubtless
command line tools available somewhere.
I suspect you may know more about this than I do (it wouldn't take
much).
--
bill the monoglot
_______________________________________________
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.