Re: BUG in expr command
[email protected] (Bob Proulx) Mon, 7 Oct 2002 13:01:04 -0600
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
> I would kindly bring to your notice an error in the functionality of the shell program 'expr'. The program malfunctions whenever we try to evaluate an expression containing the symbols '<' or '>'. After hours of debugging, I noticed that the Unix shell by default uses these symbols for redirection, so the command never gets to see these symbols. So, inspite of the mention of the symbols in the manual documenation and the in-file documentation, i.e. using the 'expr --help' command, the functionality of those is not realised.
Sorry you had such difficulty using expr. The command is one of the
oldest of the unix command set and has a syntax required by legacy
programs.
The man page for expr shows:
Beware that many operators need to be escaped or quoted
for shells.
Try this:
expr 2 '<' 3
Bob