I suspect you need to wrap the previous two lines in a begin ... end.

It'll be parsing as:
```
if x then
  stm
else
  your_rc_line
fi
your_fprintf_line
```