Just use xargs to use pipe output as follows: echo "site_path" | xargs -I % curl http://domain.com/path/%.tar