• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 'sort' command-alternative?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Regex on OS X
  • Next by Date: Re: [OT] Re: Adding a message to a mailbox in Mail
  • Previous by thread: Re: 'sort' command-alternative?
  • Next by thread: Re: 'sort' command-alternative?
  • Index(es):
    • Date
    • Thread