2019-06-01 07:04:15 +02:00
|
|
|
printf %s "$1" > program.pas
|
2019-03-13 05:37:28 +01:00
|
|
|
|
|
|
|
# fpc does not use stderr, ld however does, capture both
|
|
|
|
res="$(fpc program.pas 2>&1)"
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]; then
|
2019-06-01 07:21:22 +02:00
|
|
|
./program || true
|
2019-03-13 05:37:28 +01:00
|
|
|
else
|
2019-06-01 07:21:22 +02:00
|
|
|
printf %s "$res"
|
2019-03-13 05:37:28 +01:00
|
|
|
fi
|