Home > Mobile >  why is curl waiting for a keypress?
why is curl waiting for a keypress?

Time:11-16

I simply want to run the following command:

curl https://jkanime.net/um.php?e=VTJpeCsrL3BVY2xMaEd0YWhyM1k4SDdHelZ4OGZSeXFsOHBla1QrcnBPQm4wUWc1eE1TOThmWlBOb2xLOEJCeWlGenpML2tYelA3Tm8xU1lDMDRwUlE9PTo616MlXtdmRfi6FOwaoBRqeA--&t=5ec9cff996b02bf751b55c92c4cb1170

It seems to connect just fine, but it hangs waiting for a keypress. How can I automatize this in a script?

EDIT: I have absolutely no idea but it solved by erasing the -- part of the URL. Can someone explain to me why?

CodePudding user response:

In bash, you must use cotes (simple or double, that depends what you want to do) to build one complete string by escaping some characters : ` $ ( ) [ ] { } & | space

So, use cotes around the URL:

curl --url 'https://jkanime.net/um.php?e=VTJpeCsrL3BVY2xMaEd0YWhyM1k4SDdHelZ4OGZSeXFsOHBla1QrcnBPQm4wUWc1eE1TOThmWlBOb2xLOEJCeWlGenpML2tYelA3Tm8xU1lDMDRwUlE9PTo616MlXtdmRfi6FOwaoBRqeA--&t=5ec9cff996b02bf751b55c92c4cb1170'

CodePudding user response:

You don't describe your environment, but it's probably your shell interpreting the unquoted hyphens. In bash, double hyphens terminate processing. If you surround your URL with quotes, it will avoid this behavior and pass the quoted string to curl.

  • Related