Michel Bouchet <[EMAIL PROTECTED]> [2002-09-12 17:36:08 +0900]:
> I noticed the folowing under Linux Mandrake 8.2, with the expr command :
> 
> [eagle@WA_Mozart eagle]$ expr 2 * 3
> expr: syntax error
> [eagle@WA_Mozart eagle]$
> 
> Shouldn't the answer be 6 and not an error message ?

No.  You are forgetting that the shell is expanding file name globs
such as the '*' character.  You need to protect the '*' from the
shell.

  echo expr 2 * 3

Lots of files match *.  Must prevent that.

  echo expr 2 '*' 3

That will work.  Now do it for real.

  expr 2 '*' 3

This is one of the FAQs.  And FAQs are by definition asked
frequently.  You might want to check out the list.

  http://www.gnu.org/software/fileutils/doc/faq/

Bob


_______________________________________________
Bug-sh-utils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-sh-utils

Reply via email to