Friday, 15 March 2013

osx - How do I copy a mounted dmg's files to another location using a unix terminal? -


I am creating a Bash script that automatically runs Google Chrome on Mac OS X 10.7 in the user's application folder Download and install. . I am able to download and mount the .mg file successfully from Google's server, but I am unable to obtain the actual Google Chrome.app file from the mounted DMG. Here's what I wrote:

  # Download and install Google Chrome browser DMG = '/ mactest / googlechrome.dmg' USER = "Mac" curl https://dl.google.com / Chrome / mac / static / ggro / gucciorm dmg & gt; $ Dmg hdiutil $ dmg cp -r '/ volumes / google chrome / *' '/ user / $ user / app' hdiutil unmount '/ volume / google chrome rm $ dmg   

this script Everything is run except for this error:

  cp: / version / Google chrome / *: such a file or directory   

Any ideas?

Your error is because there is no file named * inside that folder, to single quote shell * Preventing the evaluation to match the name of the file. Try one of these instead:

  cp -r '/ version / Google chrome / Google Chrome.app' / user / $ user / app cp -r / volume / Google \ Chrome / Google \ Chrome.app / user / $ USER / app    

No comments:

Post a Comment