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