When submitting jobs, I'm getting Exit codes returned, but I have to hit the return key for them to be printed to the log.

1. prompt_line/location sas query.sas &
2. [1] 66682
3. prompt_line/location
4. [1]+  Exit 1                  nice -n 19 opt/sas/sashome/server/SASFoundation/9.4/sas 99query.sas
5. prompt_line/location
  • I submit the sas code 'query.sas' (line 1).

  • (Line 2) is put to the command line instantly confirming I've submitted the job and a new prompt line (line 3) is put to the command line instantly also.

  • I then have to hit the return key for the Exit status to be put to the command line (line 4) and a new prompt line is put to (line 5).

Where 'sas' is an alias for

nice -n 19 opt/sas/sashome/server/SASFoundation/9.4/sas

Is there a way to have a new prompt line put to the command line when an exit status is returned?


If you are using a sh-compatible shell as your interactive shell (such as bash), you may use set -b:

Report the status of terminated background jobs immediately, rather than before the next primary prompt. This is effective only when job control is enabled.

In bash, this is equivalent to set -o notify.

  • Hi, thank you! I am using a bash as you said (but I'm quite new). Where would I add set -b ? Sep 8 '17 at 10:06
  • @JackOsborne You could either just type it in at the command prompt, or add it in your .bashrc file if you want it to always be active. You may turn the option off with set +b.
    – Kusalananda
    Sep 8 '17 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.