Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I write

expr 123 \< 5  

the result is correct (0) because expr evaluates two integers.

expr 123. \< 5  

gives the expected result (1) because now it compares two strings.

expr "123" \< 5  

gives 0 (I expected 1, as before)

share|improve this question
up vote 1 down vote accepted
expr 123 \< 5


expr "123" \< 5

give the same answer because what the expr command sees in its program arguments is exactly the same in both cases. Arguments 1, 2, and 3 are 123, <, and 5 in both cases.

Use /bin/echo instead of expr to see this more clearly.

Escaping and quoting are handled by your shell. What commands see once run is what your command line ends up as after the shell has handled all redirections, expansions, and subtitutions, and removed all quoting.

share|improve this answer
Thank you... This was driving me crazy – user2431763 Jan 28 '14 at 19:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.