0

I am executing this (on a Mac):

find "/Volumes/Untitled3/Done" -type f -size +1400000k -exec mv -fv "{}" "/Volumes/Media/Overflow/" \;

When running the script in the foreground, progress is echoed to the console. As the files are quite large, it takes a while to complete, so I run it in the background (from the Scripts menu) and want to add notifications to show progress (using AppleScript via osascript):

osascript -e 'display notification theFile & " copied"'

(where theFile would be the output)

Is there a way that I can incorporate this into the -exec mv? (I appreciate that I can redirect all the output and grab it when the mv has completed, but at that point the script has finished - so it defeats the purpose.)

Lorccan
  • 793
  • 5
  • 20
  • Possible duplicate of [find -exec with multiple commands](https://stackoverflow.com/questions/5119946/find-exec-with-multiple-commands). Try `find ... -exec osascript ... \; -exec mv ... \;` – Socowi Jan 22 '19 at 11:24
  • See also https://stackoverflow.com/a/23923167/6770384. – Socowi Jan 22 '19 at 12:06
  • Thanks. The first one explained what I needed. – Lorccan Jan 22 '19 at 12:09

0 Answers0