delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/30/10:36:51

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <8F23E55D511AD5119A6800D0B76FDDE1CA2F89@cpex3.channelpoint.com>
From: Troy Noble <troy DOT noble AT channelpoint DOT com>
To: "'na na'" <shailesh_mangayil AT india DOT com>, cygwin AT cygwin DOT com
Subject: RE: Bug in red Hat linux version 7.0
Date: Mon, 30 Jul 2001 08:35:11 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
X-Scanned-By: MIMEDefang 1.0 (http://www.roaringpenguin.com/mimedefang/)

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 &quot;expr&quot; has the meaning on all Unixes .
And my experience on these Unixes starting from SCO Unix says that THIS IS
NOT HOW &quot;EXPR&quot; 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019