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

Do Shell Script


  • Subject: Do Shell Script
  • From: John Mitchell <email@hidden>
  • Date: Mon, 24 Oct 2005 16:57:23 +1000

Title: Do Shell Script
tks for feedback

At 12:01 -0700 23/10/05, email@hidden wrote:

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?

no! quoted or normal

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

still doesn't work

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.

In Terminal the location prompt is "mitchlaptop" my computer name.

here is an example path: (one line but wraps here to ...xml)
touch -acfm /Users/johnmitchell/mitchX/Applications/Graphisoft/ArchiCAD 8.1 folder/Defaults/DisplayOptionPreferences.xmlmitchX/Applications/Graphisoft/ArchiCAD 8.1 folder/Defaults/ToolBoxUIPreferences.xml

this appears to execute but doesn't. If I change it to:
touch -acfm /Applications/Graphisoft/ArchiCAD 8.1 folder/Defaults/DisplayOptionPreferences.xmlmitchX/Applications/Graphisoft/ArchiCAD 8.1 folder/Defaults/ToolBoxUIPreferences.xml

and paste into Terminal (removing "Users/johnmitchell/mitchX/") it works (and automatically adds a "\ " for spaces).

From the Retrospect log the path types are :

mitchX/Applications/Personal Applications/MYOB AccountEdge 3/Tutorial/ANZ.qif
mitchX/Users/johnmitchell/Library/Preferences/Interarchy/Bookmarks/Web/Essentials/Groups

So it appears I have to strip respectively:
mitchX - one of my disk names
and
mitchX/Users/johnmitchell - my user address

Which when I use "quoted form of"  it works

I would expect a common method to apply or am I missing something fundamental?
--
regards


John
-------------------------------------------------------------------------
CQR Pty Ltd
11 Terrell Avenue, Wahroonga, NSW 2076 Australia
Email:  email@hidden € Mob: +61 410 318 131
Skype:jrmitchell    
Tel: +61 (2) 9489 3785 € Fax: +61 (2) 9489 4035
 _______________________________________________
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
      • From: Christopher Nebel <email@hidden>
  • Prev by Date: Re: Just returning Filename... not whole path
  • Next by Date: [appscript] looking for feedback
  • Previous by thread: Re: Do Shell script
  • Next by thread: Re: Do Shell Script
  • Index(es):
    • Date
    • Thread