| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: sh.1,v 1.175 2018/01/15 11:27:39 kre Exp $ | | 1 | .\" $NetBSD: sh.1,v 1.176 2018/03/13 19:18:53 uwe Exp $ |
2 | .\" Copyright (c) 1991, 1993 | | 2 | .\" Copyright (c) 1991, 1993 |
3 | .\" The Regents of the University of California. All rights reserved. | | 3 | .\" The Regents of the University of California. All rights reserved. |
4 | .\" | | 4 | .\" |
5 | .\" This code is derived from software contributed to Berkeley by | | 5 | .\" This code is derived from software contributed to Berkeley by |
6 | .\" Kenneth Almquist. | | 6 | .\" Kenneth Almquist. |
7 | .\" | | 7 | .\" |
8 | .\" Redistribution and use in source and binary forms, with or without | | 8 | .\" Redistribution and use in source and binary forms, with or without |
9 | .\" modification, are permitted provided that the following conditions | | 9 | .\" modification, are permitted provided that the following conditions |
10 | .\" are met: | | 10 | .\" are met: |
11 | .\" 1. Redistributions of source code must retain the above copyright | | 11 | .\" 1. Redistributions of source code must retain the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer. | | 12 | .\" notice, this list of conditions and the following disclaimer. |
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 13 | .\" 2. Redistributions in binary form must reproduce the above copyright |
14 | .\" notice, this list of conditions and the following disclaimer in the | | 14 | .\" notice, this list of conditions and the following disclaimer in the |
| @@ -1422,28 +1422,29 @@ Note the distinction between those forms | | | @@ -1422,28 +1422,29 @@ Note the distinction between those forms |
1422 | .Dl Hello World! | | 1422 | .Dl Hello World! |
1423 | .Dl EOF | | 1423 | .Dl EOF |
1424 | .Dl \&} | | 1424 | .Dl \&} |
1425 | which reads and processes the | | 1425 | which reads and processes the |
1426 | .Ic here document | | 1426 | .Ic here document |
1427 | each time the shell executes the function, and which applies | | 1427 | each time the shell executes the function, and which applies |
1428 | that input only to the cat command, not to any other commands | | 1428 | that input only to the cat command, not to any other commands |
1429 | that might appear in the function. | | 1429 | that might appear in the function. |
1430 | .Pp | | 1430 | .Pp |
1431 | Variables may be declared to be local to a function by using the | | 1431 | Variables may be declared to be local to a function by using the |
1432 | .Ic local | | 1432 | .Ic local |
1433 | command. | | 1433 | command. |
1434 | This should usually appear as the first statement of a function, | | 1434 | This should usually appear as the first statement of a function, |
1435 | though is an executable command which can be used anywhere in a | | 1435 | though |
1436 | function. | | 1436 | .Ic local |
| | | 1437 | is an executable command which can be used anywhere in a function. |
1437 | See | | 1438 | See |
1438 | .Sx Built-ins | | 1439 | .Sx Built-ins |
1439 | below for its definition. | | 1440 | below for its definition. |
1440 | .Pp | | 1441 | .Pp |
1441 | The function completes after having executed | | 1442 | The function completes after having executed |
1442 | .Ar command | | 1443 | .Ar command |
1443 | with exit status set to the status returned by | | 1444 | with exit status set to the status returned by |
1444 | .Ar command . | | 1445 | .Ar command . |
1445 | If | | 1446 | If |
1446 | .Ar command | | 1447 | .Ar command |
1447 | is a compound-command | | 1448 | is a compound-command |
1448 | it can use the | | 1449 | it can use the |
1449 | .Ic return | | 1450 | .Ic return |