Error with double quote


(Sushis) #1

Hi,
I'm starting with ES and i've done a litte script.

He need use 4 parameters, $1, $2, $3 and s4

It works for $3 and s4 but not for $1 and $2.

I explain :

I have in my terminal :

./script.sh string1 string2 indexname 5

and the script :

curl -XPUT localhost:9200/$3/toto/$4 '{
tutu : "$1",
tata : "$2"
}'

It works but i have "$1" and "$2" in the place of string1 and string2

I tried with all quotes but i don't know how shell can use the inside of my vars.


(system) #2