• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do Shell script


  • Subject: Re: Do Shell script
  • From: Daniel Jalkut <email@hidden>
  • Date: Sun, 23 Oct 2005 11:42:57 -0400

Narrow your problem down to a more trivial case by changing the do shell script part to look like this:

set UNIXpath to store_target & thisItem
set myScript to "touch -acfm " & UNIXpath
-- Testing!
--do shell script myScript
log myScript

Now run the script in Log mode from the Script Editor. Grab one of the logged "myScript" values and try to copy/paste that into  a terminal window. Does it work?

Is it possible that this list of paths has spaces, etc., in it? You might need to do something like this:

set myScript to "touch -acfm " & quoted form of UNIXpath

I find that in general, it's very useful for debugging to keep the shell script composition separate from the line that actually executes it.

Daniel

On Oct 23, 2005, at 8:39 AM, John Mitchell wrote:

I have over 9000 file date errors in the log after a duplicate using Retrospect.

I thought I could write a script that read the log, found the path of the file and then UNIX touched it.

--parse the log into a list of UNIX file paths
set {flag, dsList} to processFile(theFile)

--
now update DOM to be after DOC, ie today
set current_user to (do shell script "id -un")
set store_target to ("/Users/" & current_user & "/")
repeat with thisItem in dsList
   
try
            
set UNIXpath to store_target & thisItem
       
do shell script "touch -acfm " & UNIXpath
      
on error errMsg number errNum
          
display dialog errMsg & space & (errNum as string)
     
end try
end repeat

however although I get no error (" ") the date is not updated. I tried adding "with administrator privileges" but no result.

Any suggestions?
--
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

References: 
 >Do Shell script (From: John Mitchell <email@hidden>)

  • Prev by Date: Do Shell script
  • Next by Date: items selected
  • Previous by thread: Do Shell script
  • Next by thread: Re: Do Shell script
  • Index(es):
    • Date
    • Thread