myspaghetti / macos-virtualbox

Push-button installer of macOS Catalina, Mojave, and High Sierra guests in Virtualbox on x86 CPUs for Windows, Linux, and macOS
GNU General Public License v2.0
13.5k stars 1.12k forks source link

$'\r': command not found #458

Closed weclock-droid closed 3 years ago

weclock-droid commented 3 years ago

Is there a guide where I can learn how or what exactly to set this up? I've been trying my google-fu but so far I'm stuck here:

$ /home/user/macos-guest-virtualbox.sh /home/user/macos-guest-virtualbox.sh: line 6: $'\r': command not found /home/user/macos-guest-virtualbox.sh: line 15: $'\r': command not found /home/user/macos-guest-virtualbox.sh: line 16: syntax error near unexpected token $'{\r'' 'home/user/macos-guest-virtualbox.sh: line 16:function set_variables() {

Masamune3210 commented 3 years ago

whatever you downloaded the script in fuxed the line endings I think, download it raw from github and it should work a bit better

myspaghetti commented 3 years ago

Duplicate of #28 , resolved as won't fix. Probably on installation, git was set to convert newline characters LF to CRLF. While I can configure the repository to override local Git configuration I feel like respecting local settings is the correct solution.

Configure git to keep line endings or download the script manually.

lindeloev commented 3 years ago

For anyone coming here in the future: running sed -i 's/\r$//' macos-guest-virtualbox.sh removes the \r newline characters (answer from https://stackoverflow.com/a/32912867/1297830)