echo $TMPLIST | xargs -I{} -n 1 -P $MAXJOBS curl -o {}_$DATESTRING.dump `get-temp-url --location {}`
$TMPLIST has a list of locations which I want processed. I am trying to run something similar to the above, but the brackets inside of the backticks do not get expanded. What am I doing wrong?
In this command...
echo $TMPLIST | 
xargs -I{} -n 1 -P $MAXJOBS curl -o {}_$DATESTRING.dump \
  `get-temp-url --location {}`
...the backtics are interpreted by the shell; they are never seen by xargs.  You could do something like this:
echo $TMPLIST | 
xargs -I{} -n 1 -P $MAXJOBS \
  sh -c 'curl -o {}_$DATESTRING.dump `get-temp-url --location {}`'
Note that for this to work, DATESTRING will need to be an environment variable, rather than a shell variable (e.g., you would need to export DATESTRING).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With