VolksForth/8086/msdos/emulator/run-in-dosbox.sh
Philip Zembrod d8b8f0366e First test rule for the freshly-built-from-fb-src v4th.com, including
a good deal of Makefile and run-in-dosbox.sh refactoring, e.g. the
introduction of a dosfiles/ subdir in which dosbox runs, to eliminate
the need for the Forth PATH word to run tests.
2022-01-31 00:14:47 +01:00

31 lines
544 B
Bash
Executable File

#!/bin/bash
set -e
forth="$1"
forthcmd="$2"
exit=""
bye=""
if [ -n "${forthcmd}" ]; then
logname="output.log"
doslogname="$(echo ${logname}|tr '[:lower:]' '[:upper:]')"
rm -f "${logname}" "${doslogname}"
if [ -z "${KEEPEMU}" ]; then
exit="-c exit"
bye="bye"
fi
fi
auto_c=""
autocmd=""
pathcmd=""
if [ -n "${forth}" ]; then
auto_c="-c"
if [ -n "${FORTHPATH}" ]; then
pathcmd="path ${FORTHPATH}"
fi
autocmd="${forth} ${pathcmd} ${forthcmd} ${bye}"
fi
dosbox -c "mount f ." -c "f:" "${auto_c}" "${autocmd}" $exit