What is the difference between running scripts like this?
curl -L https://url.com/install.sh/script | sh
curl -L https://url.com/install.sh/script | bash
And
curl https://url.com/install.sh/script > install.sh && sh ./install.sh
curl https://url.com/install.sh/script > install.sh && bash ./install.sh
EDIT: the reason I'm asking is that the first method gives me syntax errors, the second method works just fine.