Extract curl command in bash script