Usually when you use cURL the output looks like that:
alex$ curl http://some-url
some-content
But, for some urls the outputs is different:
alex$ curl http://some-url
[1] 81030
alex$ some-content
[1]+ Done curl http://some-url
Why is that happening and how to get rid of it and make cURL to output just the content?
Answer
Kevin's answer is helpful and Kevin deserves credit for inferring your specific problem in the absence of specific information.
Let me complement it with general recommendations:
Rather than individually escaping shell metacharacters (characters with special meaning to the shell) by \
-prefixing them, consider:
enclosing literals in single quotes; e.g.:
curl 'http://example.org/search&query=foo'
enclosing variable references in double quotes; e.g.:
url='http://example.org/search&query=foo'; curl "$url"
That way you needn't worry about what individual characters to escape.
Generally, only use unquoted literals / variable references if you explicitly want the the shell to interpret them (by applying so-called shell expansions).
No comments:
Post a Comment