0

How to assign a output of curl command execution to a variable, below is the curl example.

SCAN=$(curl -u service.account$\ --connect-timeout 3 -k -o -I -L -s -w "%{url_effective} \t %{http_code} \t %{time_total}" \n"

1) Variable1 = URL effective
2) Variable2 = Effective URL
3) Variable3 = Time Consumed
  • Quick check for duplicates: https://stackoverflow.com/search?q=%5Bbash%5D+assign+output+to+variable. https://stackoverflow.com/questions/8737638/assign-output-to-variable-in-bash. https://stackoverflow.com/questions/35640073/curl-as-variable-assign-output-to-variable – William Pursell Mar 05 '22 at 17:43

0 Answers0