myriad/languages/pascal/run.sh

11 lines
191 B
Bash
Raw Normal View History

2019-07-09 11:19:41 +02:00
printf %s "$1" > program.pas
# fpc does not use stderr, ld however does, capture both
res="$(fpc program.pas 2>&1)"
if [ $? -eq 0 ]; then
./program || true
else
printf %s "$res"
fi