jldeen / pwshcore

[Unofficial] PowerShell Core Install Scripts
http://jessicadeen.com
1 stars 3 forks source link

syntax error near unexpected token `newline' #5

Closed Mirppc closed 6 years ago

Mirppc commented 6 years ago

So i used a slightly modified fersion of the main install script to make a SUSe and OpenSUSE specific install.sh. Sadly i keep getting an error on line 7 which i have not modified.

mirvm@linux-8dvw:~/bin> sh ./install.sh ./install.sh: line 7: syntax error near unexpected tokennewline' ./install.sh: line 7: <!DOCTYPE html>'

line in question

7 psw=$(whiptail --title "PowerShell Core Install | Sudo Password Capture" --passwordbox "Sudo is required to install PowerShell Core. Please enter your sudo password to proceed with the install." 10 60 3>&1 1>&2 2>&3)

link to modified script.

https://github.com/Mirppc/pwshcore/blob/Mirppc-patch-1-suse/suse/install.sh

link to master script that the above is based on.

https://github.com/jldeen/pwshcore/blob/master/install.sh

jldeen commented 6 years ago

Thanks, I'll take a look at it and report back.

Mirppc commented 6 years ago

I have something better than a text log. I did a video recording, if that would help i would be happy to upload it if it would help.

This helped me a bit converting apt and yum commands to their zypper equivalent. http://blog.ffteixeira.net/sites/default/files/Zypper-cheat-sheet.pdf

jldeen commented 6 years ago

I wrote a single SUSE install script. Run this command to test:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/jldeen/pwshcore/dev/SUSE/install.sh)"

I tested on my end and all looks good. Please confirm it works for you, too.

Mirppc commented 6 years ago

This isnt a resolved issue. Instead of trying to debug it, i thought i would record it instead :)

Hopefully this provides some insight.

https://youtu.be/WeFTpU-Ykcs

Edit: Since i have several VM's up might as well test the Ubuntu script :). Video link will be uploaded soon.

jldeen commented 6 years ago

Unfortunately the error you’re experiencing on your branch/repo is because you took a lot of the script out so there are missing dependencies. Please try the latest install script on my dev branch for SUSE install with powershell. Alternatively, I do have a dedicated non-GUI install script available under the SUSE folder on the dev branch; I encourage you to use either of those scripts available for SUSE install.

Thanks!

Mirppc commented 6 years ago

Welp, trying it on Ubuntu failed with a similar error.

https://youtu.be/bzkUG9ThCrA

Note with this i didnt pull from my github repo, but i pulled from here.

jldeen commented 6 years ago

I noticed you’re downloading the script and running it with sh when in fact it should be run with bash. Please run the following command and let me know if you experience the same error.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/jldeen/pwshcore/dev/install.sh)"

Mirppc commented 6 years ago

Same error using bash from the locally downloaded file. seems to be working, will upload a video when it is done.

Here is my 6th attempt.

https://youtu.be/oQ1WecDreCQ

So it seems you have to use curl. so downloading the sh and running it locally will not work :( bummer.

jldeen commented 6 years ago

There are other scripts already written that will support downloading it and running it locally. I wrote this script with the sole intent of not needing to do that; you can get started with PowerShell Core, AzureRM and even azCli with one command.

Edit: Note - I tested this by downloading the file manually via curl and running with bash on OpenSUSE 42. I was able to successfully run it. To confirm, these are the commands I ran, in order:

curl https://raw.githubusercontent.com/jldeen/pwshcore/dev/install.sh > install.sh bash install.sh

I also tested running the script with sh and it ran successfully, too.

curl https://raw.githubusercontent.com/jldeen/pwshcore/dev/install.sh > install.sh sh install.sh

I believe your issue is the way you are downloading the install.sh. When you right click on the link as you are and hit download, it downloads the HTML format and not the raw format. Curl uses the raw format link. You can check this by viewing the file you downloaded in any text editor - you will see HTML, but not the .sh file.

aleorte commented 2 years ago

image

Hi, i need istall nvm. I can´t resolve this