202 |
|
|
203 |
( cd $1 |
( cd $1 |
204 |
if [ -x $2 ]; then |
if [ -x $2 ]; then |
205 |
if [ ! -r output.txt -o $quick -eq 0 ]; then |
if [ $quick -eq 0 ]; then |
|
echo runmodel: running... 1>&2 |
|
206 |
rm -f output.txt |
rm -f output.txt |
|
( ./$2 > output.txt 2>&1 ) && return 0 |
|
|
return 1 |
|
|
else |
|
|
echo runmodel: output.txt is newer than executable 1>&2 |
|
|
return 0 |
|
207 |
fi |
fi |
208 |
else |
echo -n "runmodel: " 1>&2 |
209 |
echo runmodel: executable \"$1/$2\" is missing 1>&2 |
make output.txt && return 0 |
210 |
return 1 |
# if [ ! -r output.txt -o $quick -eq 0 ]; then |
211 |
|
# echo runmodel: running... 1>&2 |
212 |
|
# ( ./$2 > output.txt 2>&1 ) && return 0 |
213 |
|
# rm -f output.txt |
214 |
|
# ( make output.txt ) && return 0 |
215 |
|
# return 1 |
216 |
|
# else |
217 |
|
# echo runmodel: output.txt is newer than executable 1>&2 |
218 |
|
# ( make output.txt ) && return 0 |
219 |
|
# return 0 |
220 |
|
# fi |
221 |
|
# else |
222 |
|
# echo runmodel: executable \"$1/$2\" is missing 1>&2 |
223 |
|
# return 1 |
224 |
fi |
fi |
225 |
) |
) |
226 |
} |
} |