'Unterminated quoted string' when installing elastic-agent

Getting this error when running the curl installation command on my VM. I'm running Kali Linux through UTM on a Mac.

"./elastic-agent: 3: Syntax error: Unterminated quoted string"

Couldn't see anything wrong with the config file but maybe I'm looking for the wrong thing? When I run the installation command it starts initially, runs through a bunch of files, asks for my password, and then gives me the error. Any help would be appreciated!

I had the same error and realized it was the architecture. I have Elastic setup on Ubuntu in VMware fusion on a Mac. While setting up a fleet server, the command to install an agent had x86-64. You have to change that to arm64. Hope that helps.