Use curl -o instead of redirection.