• 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
Passing Return-Delimited Text to UNIX Sort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing Return-Delimited Text to UNIX Sort


  • Subject: Passing Return-Delimited Text to UNIX Sort
  • From: Rick Gordon <email@hidden>
  • Date: Mon, 08 Jul 2013 22:19:31 -0700

Using AppleScript, I want to find a methodology for alphabetically sorting non-file-based data with a sort routine that doesn't require any add-on scripting additions or non-universal applications.

For instance, if I have compiled an unsorted list of strings, and then coerced that into a string of text lines separated by a return, how can I pass that to the UNIX sort command?

I've tried...
	return (do shell script "sort <<< " & (nameList as string))

... but that isn't working, nor is ...
	return  (do shell script "echo nameList as string | sort")

I'm sure this is just some basic misunderstanding. I ned to get clear on the basic principle of redirecting an existing string to a command that normally acts on files.
--
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:   http://www.shelterpub.com
 _______________________________________________
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


  • Follow-Ups:
    • Re: Passing Return-Delimited Text to UNIX Sort
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: AppleScript fails in Automator - Permissions error
  • Next by Date: Re: Passing Return-Delimited Text to UNIX Sort
  • Previous by thread: Re: Scripting iBooks Author (iAuthor)
  • Next by thread: Re: Passing Return-Delimited Text to UNIX Sort
  • Index(es):
    • Date
    • Thread