compiler-discord/docker/pascal/run.sh
2019-06-15 21:22:43 -04:00

10 lines
191 B
Bash

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