Multisystem Script Won't Work! "Syntax Error: Redirection Unexpected" Worked 2 Days Ago?

Multisystem Script Won't Work! "Syntax Error: Redirection Unexpected" Worked 2 Days Ago?

this is my first question.

I use Multisystem all of the time and have installed it on both Kubuntu and Ubuntu and have used it with no issues. I wiped my hard drive to try some new OSs I'm now using the exact same OS (Ubuntu 12.05) I used to load my USB stick to begin with and now I'm getting this ridiculous syntax error. I know the script is correct, I'm following the exact same steps I used to get to this point and I'm getting different results ?!?! I'm very confused by this.

I have no clue how to begin addressing this issue. I get the same syntax error on Kubuntu now too, which did have multisystem installed.

I run "sh install-depot-multisystem.sh" and get "Syntax error:redirection unexpected", this worked literally 2 days ago. The only thing that has changed is my face has grown some more facial hair and my head hurts from bangin it against the wall over this issue.

The OS is exactly the same, the script is the same; but now it won't install. I'm lost and really hoping someone can help.

Append

Just to append to this a bit

I needed to do a chmod 777 on the script, I'm still getting a syntax error on Kubuntu...but it did install successfully. I'll mark this as resovled!

Thanks anyway, I'll try to spruse up on my Linux skills.

1

2 Answers

The script was effective even with the syntax error, so it seems that this question really boils down to how to run a script.

Running as an Executable File

To run a script that is in the current directory without explicitly invoking the shell, you must preface its name with ./. It must also be executable.

chmod u+x install-depot-multisystem.sh
./install-depot-multisystem.sh

That will only work if the script starts with a hashbang line specifying what shell is supposed to run it.

If you ran chmod 777 on the script, and that helped, then the reason it helped was almost certainly that it gave you, as the owner of the script, execute permissions on the script. You also gave yourself and all other users read and write permissions, as well as execute permission to all other users. This is unnecessary, potentially a serious security problem. chmod u+x is just as good, and much safer.

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.