In shell script I am doing the following:
locationUrl=$(grep -r "Location:" output.txt)
fullUrl="http://test.com/temp/${locationUrl##*/}"
tempUrl="$fullUrl/tests"
echo $tempUrl
My expected output is
http://test.com/temp/226/tests
But I get this:
/tests/test.com/temp/226
The output.txt looks like bellow:
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
Location: http://test.dev:8080/webservice/temp/226
Content-Type: application/xml