Re: 'sort' command-alternative?
Re: 'sort' command-alternative?
- Subject: Re: 'sort' command-alternative?
- From: John Delacour <email@hidden>
- Date: Fri, 4 Oct 2002 10:01:14 +0100
- Mac-eudora-version: 5.3 alpha
At 9:35 am +0100 4/10/02, John Delacour wrote:
Here's a case-insensitive way, which also omits the empty lines:
....do shell script "perl -e '
@_ = split /\\n/, q(" & ls & ") ;
for (sort { uc($a) cmp uc($b) } @_) {
/\\w/ and print qq($_$/) }'"
Here's a prettier way, if you're not bothered about blank lines:
set text item delimiters to {ASCII character 10}
tell app "Finder" to set s to "" & name of processes
set text item delimiters to {""}
--
do shell script "perl -e '$strint = q(" & s & ") ; print
join $/, sort { uc($a) cmp uc($b) } split /\\n/, $strint'"
This is called rhyming perl or poggererl :-)
JD
_______________________________________________
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.