The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => The Orphanage => Topic started by: James Ladd on July 18, 2006, 03:32:31 AM

Title: Running a set of files ...
Post by: James Ladd on July 18, 2006, 03:32:31 AM
I use this shell script to iterate through a series of files and execuite them and report
if they worked or not.


#!/bin/sh
for file in `ls test*`
do
$file
if [ $? -eq 0 ]
then
echo $file passed.
else
echo $file failed.
fi
done

Title: Re: Running a set of files ...
Post by: Ian_B on July 18, 2006, 05:59:14 AM
That doesn't look like any Assembler/MASM code I've ever seen...  :eek
Title: Re: Running a set of files ...
Post by: zcoder on July 18, 2006, 06:12:49 AM
it's CGI perl.

Zcoder....
Title: Re: Running a set of files ...
Post by: Ian_B on July 18, 2006, 09:01:29 AM
That would be best posted in a CGI/Perl forum then?
Title: Re: Running a set of files ...
Post by: James Ladd on July 18, 2006, 09:17:56 AM
It's a shell script for unix.
It iterates through each file starting with "test" and executes it.
If the exit code is 0 the file passed otherwise it failed.
Title: Re: Running a set of files ...
Post by: zooba on July 18, 2006, 11:51:55 PM
The equivalent in a CMD.EXE batch file:

@ECHO OFF
FOR %%i IN (test*.exe) DO @(
    (ECHO %%i && %%i && ECHO TestPassed && ECHO.
    ) || ECHO TestFailed && ECHO.
)
Title: Re: Running a set of files ...
Post by: James Ladd on July 19, 2006, 09:55:05 PM
Thanks for the windows version.
I use cygwin under windows so I can keep my scripts the same between environments.