I want to make a bash script which has to use wget and run its output with bash like this:
wget -q -O - http://pastebin.com/raw.php?i=VURksJnn | bash
The pastebin file is a test script, but this commands shows me: "Unknown command" (maybe due to new lines) and "Unexpected end of file", and I don't know why.
Am I missing something?
Your script has DOS line-endings.
If you convert the line endings to Unix line endings, it runs fine:
$ tr -d '\r' < raw.php\?i\=VURksJnn > script
$ cat script | bash
Test script
You're not root
End test
$