delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/29/17:54:33

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=BAYES_00,DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG
X-Spam-Check-By: sourceware.org
Message-ID: <21737864.post@talk.nabble.com>
Date: Thu, 29 Jan 2009 14:54:20 -0800 (PST)
From: whitewall <thewhitewall AT live DOT co DOT uk>
To: cygwin AT cygwin DOT com
Subject: Setting Integer Variables in Bash
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

The text below is from a text file.  If I type the commands line-by-line in
the bash then the commands work as expected.  If I save the commands in a
text file and call the script I get the error message:
': not a valid identifier2: declare: 'Red
': not a valid identifier3: declare: 'Green

#! /cygdrive/c/cygwin/bin/bash
declare -i Red
declare -i Green
Red=10
Green=$Red+1
echo $Green
exit 0
-- 
View this message in context: http://www.nabble.com/Setting-Integer-Variables-in-Bash-tp21737864p21737864.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
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/

- Raw text -


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