CygwinReturnCode

g frances gfrancess@hotmail.com
Sat Nov 23 03:32:00 GMT 2002


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/



More information about the Cygwin mailing list