title: curl from shell script
body: <p>I am trying to delete few objects using curl. I have a list of ids for the onjects in a file. 
  I loop through the list and issue a del like this:</p>
  
  <pre><code>bash -x del.sh tempId.log
  
  + read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  + curl -H 'Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA' -X DELETE https://url/id
  [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]+ read id
  </code></pre>
  
  <p>This is the script</p>
  
  <pre><code>   #!/bin/bash
      while read id; do
      curl -H "Authorization:OAuth 00D30000001FxvA%21AQEAQKkcrruykRDNDapigaEdJXOc4SS_D27o686DScK8pU22BeMsgWVsWJ.Nv0DXimx2zBFKYlAUeDnGgokY2pU8m9xMoe73&amp;apv=1&amp;cshc=0000004qUmq0000001FxvA" -X DELETE https:url/$id
      done &lt;$1
  </code></pre>
  
  <p>However, if I run the same curl command on the terminal it works fine !</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks!</p>