delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/23/03:43:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Originating-IP: [12.213.113.158]
From: "g frances" <gfrancess AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: CygwinReturnCode
Date: Sat, 23 Nov 2002 08:42:47 +0000
Mime-Version: 1.0
Message-ID: <F131S7vNiRS2WKhLhoG0002d88c@hotmail.com>
X-OriginalArrivalTime: 23 Nov 2002 08:42:47.0883 (UTC) FILETIME=[4CC619B0:01C292CC]

Hi All,
I have the following script running in Cygwin 1.3.15(0.63/3/2)on Windows 
2000, service pack 2.  It runs great at the NT

command prompt(cmd.exe) and I get an approprite return code of 1 or 0 (after 
I change the / to \.)
In cygwin I always get a return code of 0 no matter whether it passes or 
fails.  Python 2.2.2 (#1, Nov 15 2002, 07:49:04)[GCC

2.95.3-5 (cygwin special)]is installed, Perl on cygwin v5.6.1 built for 
cygwin-multi as well as the Cygwin TEX packages,

tetex-beta, texmf, texmf-base, and texmf-extra.

It's coded this way because I don't have the source code to the *.exe files 
and they always return 1 not matter whether or

not they pass or fail.  I need the script to return a 0 if pass and a 1 if 
any of the tests fail.  Any ideas of what might be

going on?
Thanks,
gfrancess


#!/bin/python
import os, sys, string


returncode=0
front='c:/tests d:'
last=r' > c:/temp/out.txt'

testlist=['CopyTest.exe','DeleteTest.exe','ReadTest.exe','CopyAllTest','AttributeTest']
for test in testlist:
	run = front+test+last
	print(run)
	os.system(run)
	os.system(r'cat c:/temp/out.txt')
	returncode = os.system(r' grep SUCCESS c:/temp/out.txt')
	if returncode == 1:
		returncode == 1

sys.exit(returncode)


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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