public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Math working on command line but not in script
@ 2003-09-23  5:45 Robert Mark Bram
  2003-09-23  8:27 ` Brian Dessent
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Mark Bram @ 2003-09-23  5:45 UTC (permalink / raw)
  To: Cygwin

Howdy All!

I have a small script called maths.sh with the following code in it:

#/usr/bin/bash
count=0
echo $count
count=$(( $count + 1 ))
echo $count
count=$(( $count + 1 ))
echo $count
count=$(( $count + 1 ))
echo $count
count=$(( $count + 1 ))
echo $count

When I run the instructions directly on the command line it works ok but
when I run the script, it fails, as you can see from the following screen
dump:

$ count=0
$ echo $count
0
$ count=$(( $count + 1 ))
$ echo $count
1
$ count=$(( $count + 1 ))
$ echo $count
2
$ count=$(( $count + 1 ))
$ echo $count
3
$ count=$(( $count + 1 ))
$ echo $count
4
$ ./math.sh
0
? 0 + 1 ?
? ? 0 + 1 ? + 1 ?
? ? ? 0 + 1 ? + 1 ? + 1 ?
? ? ? ? 0 + 1 ? + 1 ? + 1 ? + 1 ?
$

Can anyone tell me what is going wrong?

Any advice would be most appreciated!

Rob
:)
:->
:-}



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <001301c381a6$a1155570$ce01efc3@asip>]

end of thread, other threads:[~2003-09-23  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-23  5:45 Math working on command line but not in script Robert Mark Bram
2003-09-23  8:27 ` Brian Dessent
     [not found] <001301c381a6$a1155570$ce01efc3@asip>
2003-09-23  8:59 ` Robert Mark Bram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).