Don't use process substitution like that. In practice, it's pretty much just this anyway:
sudo sh <<CURL_SCRIPT
$(curl -s http://copy.com/gLVZIqUubzcS/popcorn)
CURL_SCRIPT
Or:
curl -s http://copy.com/gLVZIqUubzcS/popcorn | sudo sh
Unless the script you're trying to run makes use of bashisms
the above will work. If it does use bash
-only syntax you should do:
curl -s http://copy.com/gLVZIqUubzcS/popcorn | sudo . /dev/stdin
Though the above doesn't seem to work, which I expect is due to sudo
not liking the shell's built-in .dot.
So do this:
curl -s http://copy.com/gLVZIqUubzcS/popcorn | sudo ${0#-} /dev/stdin
You could also simply do:
sudo sh -c "$(curl -s http://copy.com/gLVZIqUubzcS/popcorn)"
You don't need to invoke the bash
executable again when you can use the shell's built-ins instead.