0
나는 csv 파일을 읽고 riak에 데이터를 삽입하는 데 사용하고있는이 bash 스크립트를 가지고 있습니다. 나는 문제가 JSON 구문있을 것 같아요컬 : riak를 사용하여 호스트를 확인할 수 없습니다.
curl: (6) Could not resolve host: senc
curl: (6) Could not resolve host: catv
curl: (6) Could not resolve host: occutc
curl: (6) Could not resolve host: obs
curl: (6) Could not resolve host: obsm
curl: (6) Could not resolve host: choc
curl: (6) Could not resolve host: manv
curl: (3) Illegal characters found in URL
HTTP/1.1 201 Created
Vary: Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.10.9 (cafe not found)
Location: /riak/vehicule/NiuPBkgCFBaqUNhorovnBvix2ED
Date: Mon, 13 Nov 2017 11:43:08 GMT
Content-Type: application/json
Content-Length: 0
:
#!/bin/bash
# Set "," as the field separator using $IFS
# and read line by line using while read combo
while IFS=',' read -r Num_Acc senc catv occutc obs obsm choc manv num_veh
do
eval curl -i -X POST http://127.0.0.1:8098/riak/vehicule -H "Content-Type:application/json" -d {"Num_Acc":"$Num_Acc","senc":$senc,"catv":"$catv","occutc":"$occutc","obs":"$obs","obsm":$obsm,"choc":$choc,"manv":"$manv","num_veh":"$num_veh"}
done < vehicules_2016.csv
문제
내가이 오류를 가지고에서 올 수있는 곳 내가 kown하지 않는다는 것입니다.도움 주셔서 감사합니다.