bash : replace variable value inside ' '

后端 未结 3 1003
天涯浪人
天涯浪人 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:55

    This is because variables inside the single quotes '' are not being replaced. If you want variable substitution, you need to get rid of the single quotes.

    You coul maybe pre-initialize that variable

    foo="something $i bla bla bla"
    curl "something ... ${foo}something"
    

提交回复
热议问题