How to pass a variable in a curl command in shell scripting

前端 未结 3 1415
予麋鹿
予麋鹿 2020-12-13 06:37

I have a curl command:

curl -u ${USER_ID}:${PASSWORD} -X GET \'http://blah.gso.woo.com:8080/rest/job-execution/job-details/${job_id}\'

The

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 07:28

    userdetails="$username:$apppassword"
    base_url_part='https://api.XXX.org/2.0/repositories'
    path="/$teamName/$repoName/downloads/$filename"
    base_url="$base_url_part$path"**strong text**
    curl  -L -u "$userdetails" "$base_url" -o "$downloadfilename"
    

提交回复
热议问题