I am probably doing something stupid/obviously wrong here, but I am trying to pipe in a script with curl and run it in Terminal on OS X. The command I'm using to do this is:
sh -s stable < <(curl -L http://path_to_my_script/)
This appears to be working perfectly correctly; however, the first line in the downloaded script isn't working. For some reason, "cd ~/Desktop" is causing the error "No such file or directory". I am quite sure that my desktop exists, and this command works when I manually run it. When I tried putting in "ls" as the first line to diagnose the problem, it didn't even recognize the command. Is there something I need to be doing to make commands like "cd" and "ls" work properly?
Thanks for the help!
EDIT: The problem does not appear to have anything to do with the curl, as if I download the script into "file.sh" and then execute "sh file.sh", I get the same errors.
EDIT: Here is the full content of the script I'm trying to run:
#!/bin/bash ls cd ~/Desktop curl https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg -o chrome.dmg hdiutil attach chrome.dmg cp "/Volumes/Google Chrome/Google Chrome.app" "~/Desktop/chrome.app" hdiutil detach chrome.dmg rm chrome.dmg open -a chrome.app --args --make-default-browser --disable-instant-extended-api -- install-from-webstore="chrome-rdp/cbkkbcmdlboombapidmoeolnmdacpkch" osascript 'tell application "System Preferences" activate set the current pane to pane id "com.apple.preference.mouse" end tell'