This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| shell:if-for-while-function-variable [2026/07/27 17:34] – [While] tmade | shell:if-for-while-function-variable [2026/10/19 16:38] (current) – [Function] tmade | ||
|---|---|---|---|
| Line 465: | Line 465: | ||
| fi | fi | ||
| </ | </ | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | |||
| + | function test { | ||
| + | echo $1 | ||
| + | echo $2 | ||
| + | } | ||
| + | |||
| + | test first second | ||
| + | </ | ||
| + | |||
| + | Output: | ||
| + | first | ||
| + | second | ||
| + | |||
| + | |||
| + | |||
| Example: | Example: | ||