2
我正在制作一个bash脚本,该脚本会自动将Google Chrome下载并安装到运行OSX 10.7的MacBook Pro上的用户应用程序文件夹中。我能够成功下载并挂载Google服务器上的.dmg文件,但我无法从挂载的dmg中获取实际的Google Chrome.app文件。以下是我已经写了:如何使用unix终端将安装的dmg文件复制到其他位置?
#Download and Install Google Chrome browser
DMG='/mactest/googlechrome.dmg'
USER="Mac"
curl https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg > $DMG
hdiutil attach $DMG
cp -r '/Volumes/Google Chrome/*' '/Users/$USER/Applications'
hdiutil unmount '/Volumes/Google Chrome'
rm $DMG
在按预期投放,除了这个错误这个脚本一切运行:
cp: /Volumes/Google Chrome/*: No such file or directory
什么想法?
使用双引号“而不是单个”,因此shell将为您扩展* – Joe