bash : replace variable value inside ' '

后端 未结 3 1025
天涯浪人
天涯浪人 2021-01-15 04:23

Sorry if the question is very straight forward but am a newbie to shell scripting. I am trying to write something like this :

for i in {1..20}
do
   curl \"         


        
3条回答
  •  情深已故
    2021-01-15 04:54

    Your quoting is not correct. You don't need double quotes around the second $i because the whole thing is already surrounded in double-quotes.

    Change it to the following:

    for i in {1..20}
    do
       curl "something $i ........ -d  'something $i something'"
    done
    

提交回复
热议问题