Reputation: 7734
I am using Ubuntu on AWS.
And I'm trying to type this:
curl https://www.google.com/?1
But it always gets this:
curl https://www.google.com/\?1
There is an extra backslash \
.
Why this is happening? If I don't enter this after curl
, then the \
won't show up. How can curl
make modifications to my shell?
Upvotes: 1
Views: 312
Reputation: 369556
The question mark has special meaning in the shell. The backslash also has special meaning in the shell: it is an escape character that removes the special meaning from the following character.
It looks like you want to use the question mark simply as a question mark and not with its special meaning. Therefore, you have to escape it, i.e. add the backslash to it. Otherwise, the command you are entering would mean something different, and probably not do what you intend to do.
Why this is happening?
It looks like your shell tries to help you out by adding the backslash for you. If you are 100% sure that you do want the special behavior of the question mark, then you can simply delete the backslash.
If you are 100% sure that you always know better than the programmer who wrote the shell how the shell works, I am sure, there is some way to turn this feature off.
Note: It might not be the shell exactly that does this. It is more likely that the shell supports some hook functions to help with input and you have set up a hook function that does these kinds of modifications for you.
How can
curl
make modifications to my shell?
It doesn't. Simple basic logic tells you that it cannot possibly be curl
that is doing this, since it happens while you are entering the command. Obviously, before you hit enter, curl
isn't even running, so clearly it cannot do anything if it doesn't run.
Upvotes: 1