Mail Archives: cygwin/2001/07/30/10:36:51
How does this relate to cygwin?
Anyway, I don't think it's a bug in RedHat 7.0 either, but rather
a problem with the way you are calling expr.
The following should work on either cygwin or your favorite flavor
of Unix in bash. Note that you need the back-quotes around
the entire call to expr, and you also need to have a space before
and after your + operator since these are args to the expr
process. It doesn't like having them all glommed together
into a single argument in other words.
bash$ a=22
bash$ a=`expr $a + 10`
bash$ echo $a
32
Alternatively, your shell may support arithmetic expansion
(bash does) which would save you making a call to expr. Once
again, spacing and punction is important, but not quite so
critical within the expression itself since you're not passing
args to a process. example:
bash$ a=22
bash$ a=$(( $a+10 ))
bash$ echo $a
32
Give those a try. I'd be very surprised if they didn't work
on RedHat 7.0. If they don't, you need to report a bug to
RedHat folks... not to the cygwin list.
Troy
-----Original Message-----
From: na na [mailto:shailesh_mangayil AT india DOT com]
Sent: Monday, July 30, 2001 7:50 AM
To: cygwin AT cygwin DOT com
Subject: Bug in red Hat linux version 7.0
May I straightaway start describing the bug ?
[sam AT org DOT org sam]expr 10/2 #which should output 5
10/2
[sam AT org DOT org sam]a=22
[sam AT org DOT org sam]a=`expr $a`+10
[sam AT org DOT org sam]echo $a
22+10
[sam AT org DOT org sam]
[sam AT org DOT org sam]clear
[sam AT org DOT org sam]
Obviously "expr" has the meaning on all Unixes .
And my experience on these Unixes starting from SCO Unix says that THIS IS
NOT HOW "EXPR" works.
Please suggest to me (at : shyamk AT eth DOT net because my mailbox was full)
what you have done , once you solve the bug.
Thanks , Regards , & Best Wishes,
(shyamk AT eth DOT net)
Shyam
--
_______________________________________________
Get your free email from http://mail.india.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -