Jerry Krinock wrote:

You've almost got it. I believe this might come close to working, assuming for example that you want -Rf options on cp:

...
   <key>Program</key>
   <string>/bin/cp</string>
   <key>ProgramArguments</key>
   <array>
       <string>-R</string>
       <string>f</string>


If you want -Rf options, I'm pretty sure it should be:

       <string>-Rf</string>

Otherwise it needs to be:
       <string>-R</string>
       <string>-f</string>

It's an imperfect analogy, but think of each <string> element as equivalent to a quoted element in the command-line.

This:
  cp "-Rf" "/source/path" "/dest/path"

is very different from this:
  cp "-R" "f" "/source/path" "/dest/path"

I will also point out you can use actual bash command-lines, with wild-cards and IO-redirection and everything, by running bash with the -c option. This has its risks, but it also has its uses.

I don't recommend this for the inexperienced, because it's too easy to make disastrous mistakes in a launch-agent. It will then execute with all the unstoppable indifference of the enchanted broomstick from the Sorceror's Apprentice segment of Disney's Fantasia, only much MUCH faster.

  -- GG

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to