Re: 'sort' command-alternative?
Re: 'sort' command-alternative?
- Subject: Re: 'sort' command-alternative?
- From: Shane Stanley <email@hidden>
- Date: Sun, 06 Oct 2002 18:01:47 +1000
On 6/10/02 5:11 AM +1000, bill fancher, email@hidden, wrote:
>
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.
I guess my real query is more general. We have all these seemingly useful
new utilities, but advice on how to use them consists largely of looking at
man.
What seems to me to be missing is some sort of general guide for AS uses:
something that says what line delimiters to use, how to handle quotes and
any other special characters, whether things like sorts will give different
results to standard Mac sorting, how the various flavors of text are handled
(or not), and how things like high-ASCII characters are handled. There are
probably other issues I'm missing, but you get the idea.
Throw in simple explanations of what things like standard input and output
are, and maybe something about echo and the use of pipes, and all of a
sudden the whole facility is much more useable by the average Unix-ignorant
scripter.
--
Shane Stanley, email@hidden
_______________________________________________
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.