[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: expr weirdness



On Wed, Feb 09, 2005 at 12:51:42AM +0200, andras.lorincz@gmail.com wrote:
> Why does expr give me "syntax error" message when I'm trying to do a simple 
> thing like this:
> 
> expr 2 * 3
> 
> Other operators like +, - and / work.

Because the shell is replacing the * with a list of all the files in
the current directory. You need to escape it:

$ expr 2 \* 3
6

-- 
Pigeon

Be kind to pigeons
Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F

Attachment: signature.asc
Description: Digital signature


Reply to: