• 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: do shell script "sort" not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do shell script "sort" not working


  • Subject: Re: do shell script "sort" not working
  • From: pete boardman <email@hidden>
  • Date: Wed, 9 Nov 2005 09:39:34 +0000

On 8 Nov 2005, at 20:12, Chris Tangora wrote:

Can someone take a look and tell me if there is something I am missing?

set RootFileFolder to ("HardDrive:Users:User:Scripts:PDF_Image_Counter")

set ImagesUsed_log to (RootFileFolder & ":ImagesUsed.log") as string
set ImagesUsed_POSIX to POSIX path of ImagesUsed_log
set ImagesSorted_log to (RootFileFolder & ":ImagesSorted.log") as string
set Imagessorted_POSIX to POSIX path of ImagesSorted_log


set sort_script to ("sort -o " & Imagessorted_POSIX & " " & ImagesUsed_POSIX)
do shell script sort_script

As Mark said, you are probably having CRuLF problems... You could convert the line feeds as you go:


set sort_script to ("cat " & quoted form of ImagesUsed_POSIX & " | tr \"\\015\" \"\\012\" | sort -o " & quoted form of Imagessorted_POSIX)

(- I use the octal codes for CR and LF because using "\r" and "\n" looks odd when compiled.)

Or perhaps create the files using the LFs that UNIX commands prefer?

(I used 'quoted form' because I tried it on a folder called "untitled folder" - space prevented it from running...)

Pete

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: do shell script "sort" not working
      • From: "Mark J. Reed" <email@hidden>
References: 
 >do shell script "sort" not working (From: Chris Tangora <email@hidden>)

  • Prev by Date: Re: eppc: and crashes
  • Next by Date: RE: Who has that property?
  • Previous by thread: Re: do shell script "sort" not working
  • Next by thread: Re: do shell script "sort" not working
  • Index(es):
    • Date
    • Thread