Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
How to Google a question mark?

I saw a trick in a book:

In a linux shell, we can use $? to get the return value of a command. For example, after we run a command, if it exits normally, the return value is 0. Then when we type $?, we will get 0 in the screen.

I want to google this kind of usage, so I have to type these two symbols $? in the search blank. But the search engine just returns nothing to me...

I have looked at the Google help page, but still can't find a solution.

So my question is: How can I search for this kind of keyword?

Or if you can give me some advise on the usage of $? or that sort of thing, that will be also appreciated.

share|improve this question

migrated from stackoverflow.com May 23 '10 at 17:38

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Arjan, random May 24 '10 at 2:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

  • Although it's hard to believe sometimes, Google isn't magic :)
  • Web search relies on an index and index is built of tokens. Usually punctuation is removed before tokenization of your query. Some special cases exist, which are probably determined from popular queries (For example, google recognizes c++).
  • So, when you type $?, google throws away punctuation and you have no query :)
  • You can google search for 'bash variables', which led to this page: section 3.2.5: Special Parameters that details $?.
  • Alternatively run man bash from your command line and there's an overview.
share|improve this answer

bash(1) man page, PARAMETERS section, Special Parameters subsection.

share|improve this answer