CURL Flucht in einfache Anführungszeichen

Wie kann ich diese Arbeit machen?

curl -XPOST 'http://localhost:9290/location/place' -d '{"geoloc": {"lat": "38.1899", "lon": "-76.5087"}, "longitude": "-76.5087", "admin_name1": "Maryland", "admin_name2": "St. Mary's", "admin_name3": "", "postal_code": "20692", "admin_code3": "", "country_code": "US", "admin_code1": "MD", "latitude": "38.1899", "admin_code2": "037", "accuracy": null, "place_name": "Valley Lee"}'

Den ' im Mary's ist die Ursache HIERFÜR zu Versagen. Ich führe es aus einer Datei wie cat curl-cmd.txt | sh aber es wird nicht funktionieren aus der command line. Ich habe versucht, mit \' und \\' und \u0027 (die unicode -')

Bin ich fest

  • stackoverflow.com/a/18612754/1745672
  • Recht, wie ich schon in meiner Frage, ich habe versucht.
  • Verdammt Im blind..
  • Haha, keine Sorge. Es ist nur zu zeigen, wie die wörtliche \u0027 und nicht interpretiert wird als escape-Sequenz.
InformationsquelleAutor mikeb | 2015-08-20
Schreibe einen Kommentar