I'm trying to create a simple bash script to get the HTTP codes from CURL
So here is my code :
#!/bin/bash
AWKRESULT = $(curl -sL -w "result=%{http_code}" "http://192.168.8.69:8080/myReport/archive" -o "/tmp/reportlog" | awk -F= '{print $2}')
echo $AWKRESULT
the result of
curl -sL -w "result=%{http_code}" "http://192.168.8.69:8080/myReport/archive" -o "/tmp/reportlog" | awk -F= '{print $2}'
is 500.
However it's always has this result :
./test.sh[2]: AWKRESULT: not found.
any idea what am I missing?