You can return a process exit status to the Operating System when LispWorks or a delivered LispWorks application quits.
Do this by passing a status value to the function quit. For example:
(quit :status 42)
LispWorks User Guide and Reference Manual - 20 Sep 2017