myriad/languages/pascal/run.sh
2020-06-17 01:43:31 -04:00

10 lines
172 B
Bash

cat > program.pas
# fpc does not use stderr, ld however does, capture both
res="$(fpc program.pas 2>&1)"
if [ $? -eq 0 ]; then
./program
else
printf %s "$res"
fi