This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Bug in red Hat linux version 7.0


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@india.com]
Sent: Monday, July 30, 2001 7:50 AM
To: cygwin@cygwin.com
Subject: Bug in red Hat linux version 7.0


May I straightaway start describing the bug ?
[sam@org.org sam]expr 10/2  #which should output 5
10/2
[sam@org.org sam]a=22
[sam@org.org sam]a=`expr $a`+10
[sam@org.org sam]echo $a
22+10
[sam@org.org sam]
[sam@org.org sam]clear
[sam@org.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@eth.net   because my mailbox was full)
what you have done , once you solve the bug.

Thanks , Regards , & Best Wishes,
(shyamk@eth.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]