I have a bash script where i need to send queries to a rest api server using curl.
I'm tring to do this:
$(curl -m100000000000000000000000000000000 -X POST -H "Content-Type: application/json" -d'{"queryType":"SQL", "query": "create table hdfs.bigdata.`databases/'$cleantn'/'$timestamp'` AS (SELECT * FROM dfs.`'$tempfile'`)"}' http://localhost:8047/query.json)
I can't get it to work. The * is being evaluated from bash
putting it in a variabile still dosen't work
query='{"queryType":"SQL", "query": "create table hdfs.bigdata.`databases/'$cleantn'/'$timestamp'` AS (SELECT * FROM dfs.`'$tempfile'`)"}'
$(curl -m100000000000000000000000000000000 -X POST -H "Content-Type: application/json" -d''$query'' http://localhost:8047/query.json)
#or
$(curl -m100000000000000000000000000000000 -X POST -H "Content-Type: application/json" -d"$query" http://localhost:8047/query.json)
- - , .
برچسب:
نویسنده: استخدام کار