exit.rst 674 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. exit command
  2. ============
  3. Synopsis
  4. --------
  5. ::
  6. exit
  7. Description
  8. -----------
  9. The exit command terminates a script started via the run or source command.
  10. If scripts are nested, only the innermost script is left.
  11. ::
  12. => setenv inner 'echo entry inner; exit; echo inner done'
  13. => setenv outer 'echo entry outer; run inner; echo outer done'
  14. => run outer
  15. entry outer
  16. entry inner
  17. outer done
  18. =>
  19. When executed outside a script a warning is written. Following commands are not
  20. executed.
  21. ::
  22. => echo first; exit; echo last
  23. first
  24. exit not allowed from main input shell.
  25. =>
  26. Return value
  27. ------------
  28. $? is always set to 0 (true).