[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun, 18 May 2003 12:15:50 -0600
Thanks for the report. But first, please put a meaning subject line
on your messages when you send them. It increases the readability and
with it the likelyhood that you message will be read and responded to.
> bash> expr 8 * 2
> expr: symtan error
> bash> expr ( 8 * 2 )
> bash: syntax error near unexpected token '8'
You are forgetting that the shell is expanding shell metacharacters
prior to handing the the args to the command.
Try this. What do you see? If you were the command 'expr' would that
make sense to you?
echo expr 8 * 2
The correct thing to do here is to quote the shell metacharacters.
expr 8 '*' 2
expr '(' 8 '*' 2 ')'
Hope this helps,