Há certamente uma solução mais elegante do que isso, mas, acima de tudo, uma forma rápida e suja de fazer isso seria algo como:
#!/bin/bash
xauthtoken='curl -D - \
-H "X-Auth-Key: 123456789abcdefghijk" \
-H "X-Auth-User: MyUsername" \
https://auth.api.rackspacecloud.com/v1.0 | grep X\-Auth\-Token | awk '{print $2}''
xstorageurl='curl -D - \
-H "X-Auth-Key: 123456789abcdefghijk" \
-H "X-Auth-User: MyUsername" \
https://auth.api.rackspacecloud.com/v1.0 | grep X\-Storage\-Url | awk '{print $2}''
curl -X PUT -T foo.txt -D - \
-H "ETag: 7849eb8d56581fa7c4896bb0db64892c" \
-H "Content-Type: text/plain" \
-H "X-Auth-Token: ${xauthtoken}" \
-H "X-Object-Meta-Screenie: Test" \
$xstorageurl