[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in expr?
From: |
Bob Proulx |
Subject: |
Re: Bug in expr? |
Date: |
Fri, 8 Jun 2001 22:00:04 -0600 |
> I am writing a script and appear completely unable to employ expr.
>
> It works for plus but for no other operators. I need *.
Are you forgetting that * is a shell metacharacter and would need to
be protected from shell expansion? Check this with echo.
echo expr 2 * 3
You want to quote the * by any of the shell quoting methods.
echo expr 2 '*' 3
echo expr 2 "*" 3
echo expr 2 \* 3
The same goes for other shell metacharacters as well. Check out the
man page or info page on your shell. 'info bash'
Hope that helps
Bob
- Bug in expr?, Simon Wallis, 2001/06/06
- Re: Bug in expr?,
Bob Proulx <=