I have the command here
doctl compute ssh testdroplet --ssh-command 'echo -e "import http.server\nimport socketserver\nfrom http import HTTPStatus\n\nclass Handler(http.server.SimpleHTTPRequestHandler):\n def do_GET(self):\n self.send_response(HTTPStatus.OK)\n self.end_headers()\n self.wfile.write(b'Hello world')\n\nhttpd = socketserver.TCPServer(('', 8000), Handler)\nhttpd.serve_forever()" >> web/server.py'
which I need to write single quotes into a file. I changed the format to use single quotes outside echo because when I used double quotes the single quotes were not written to file (everything except the single quotes was written to file).
Now instead of a working command I get error
deploy_server % ./deploy_droplet.sh
root@142.93.555.190's password:
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
Error: exit status 1
How can I successfully write to file but also write in these single quotes? Thank you