Jump to content

OSX CMD File

Hey guys, 

I'm trying to write a script to install multiple DMGs, and PKGs from a specific folder in OSX. Does anyone have experience with this?

Here's what I have so far:

Sudo cp -R /desktop/#installers/Firefox.app /applications &&

Sudo cp -R /desktop/#installers/Google Chrome.app /applications &&

Sudo installer -pkg /desktop/#installers/Install Smart Learning Suite 17.0.pkg -target /applications &&

Sudo installer -pkg /desktop/#installers/Microsoft_Office_2016_15.37.17081500_Volume_Installer.pkg -target /applications &&

Sudo softwareupdate --install 'macOS High Sierra 10.13.6 Update- ' &&

Sudo softwareupdate --install 'iTunesX (12.8)' &&

Sudo shutdown -r now

Whenever the script is run, I recieve this error:

No such File or Directory

Link to comment
Share on other sites

Link to post
Share on other sites

Do you need to put your paths in quotes "like this"?  That would be my first guess.  Does it tell you what file or directory it thinks you've asked for?  That would help you figure out what the problem is.  Just saying it's not found doesn't really help xD

 

Edit: might also be that sudo is capitalized.  iirc Mac OS's file system is (or at least can be) case sensitive and the sudo command isn't capitalized.  IF that's it though it should have given you a "Command not recognized" error or something like that.

Edited by Ryan_Vickers

Solve your own audio issues  |  First Steps with RPi 3  |  Humidity & Condensation  |  Sleep & Hibernation  |  Overclocking RAM  |  Making Backups  |  Displays  |  4K / 8K / 16K / etc.  |  Do I need 80+ Platinum?

If you can read this you're using the wrong theme.  You can change it at the bottom.

Link to comment
Share on other sites

Link to post
Share on other sites

It's 'desktop/file.txt' or '~/Desktop/file.txt'.

PSU Tier List | CoC

Gaming Build | FreeNAS Server

Spoiler

i5-4690k || Seidon 240m || GTX780 ACX || MSI Z97s SLI Plus || 8GB 2400mhz || 250GB 840 Evo || 1TB WD Blue || H440 (Black/Blue) || Windows 10 Pro || Dell P2414H & BenQ XL2411Z || Ducky Shine Mini || Logitech G502 Proteus Core

Spoiler

FreeNAS 9.3 - Stable || Xeon E3 1230v2 || Supermicro X9SCM-F || 32GB Crucial ECC DDR3 || 3x4TB WD Red (JBOD) || SYBA SI-PEX40064 sata controller || Corsair CX500m || NZXT Source 210.

Link to comment
Share on other sites

Link to post
Share on other sites

Whenever you do a / at the beginning, the shell is going to start at root, not at the directory the script launched from. So you either need to provide an absolute path to add a period to the beginning of those paths. e.g.,

 

Sudo cp -R ./desktop/#installers/Firefox.app ./applications &&

-- OR --

Sudo cp -R /home/[username]/desktop/#installers/Firefox.app /home/[username]/applications &&

-- OR (if everything is in the home directory) --

Sudo cp -R ~/desktop/#installers/Firefox.app ~/applications &&

Also macOS, since it's supposed to be UNIX, may be case sensitive. But if those have worked with other arguments then carry on.

Edited by M.Yurizaki
Forgot to change the second argument.
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×