-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Saran on 8/11/2005 4:43 AM:
> To whom so ever it may concern..
> 
> Hi,
> I find that the expr command in my linux shell is not working for multiplying 
> two arguments. please help me out how could i multiply two numbers in a shell 
> and how could i use the command in my shell scripts..
> when i type expr 2 * 3 it is giving syntax error.
> whereas if i type expr 2 + 3 it is giving me the correct result '5'.

This is turning into a FAQ; although the FAQ page at
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html doesn't
mention expr by name, it does mention problems with * as a shell
metacharacter, which needs to be quoted.

Try "echo expr 2 * 3" to see what you are really doing.  And compare that
to "echo expr 2 \* 3".

- --
Life is short - so eat dessert first!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC+0/g84KuGfSFAYARAuZRAJ9DooJLmd0kf2igT2kCDUUblsrkxwCeLy8J
ns7moJ6uG53FvYoe0cUKGmU=
=ni7b
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to