From d89ed54a8b91666f1c88cbdb3ae5673d8ddea2b2 Mon Sep 17 00:00:00 2001 From: green Date: Wed, 14 Apr 2004 15:58:50 +0000 Subject: Document the "return" built-in better: it will exit . (sources) and the top-level shell instance, too. --- bin/sh/sh.1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 9cfde31..3aba4cb 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -871,7 +871,8 @@ command is .Op Ar exitstatus .Ed .Pp -It terminates the currently executing function. +It terminates the current executional scope, returning from the previous +nested function, sourced script, or shell instance, in that order. The .Ic return command is implemented as a built-in command. @@ -1249,6 +1250,11 @@ command is provided for efficiency. A null command that returns a 0 (true) exit value. .It Ic \&. Ar file The commands in the specified file are read and executed by the shell. +The +.Ic return +command may be used to return to the +.Ic \&. +command's caller. If .Ar file contains any -- cgit v1.1