Timeline for How to pass parameters to function in a bash script?
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Jan 14, 2018 at 17:31 | history | suggested | Jonas Stein | CC BY-SA 3.0 |
add one more tag
|
| Jan 14, 2018 at 13:21 | review | Suggested edits | |||
| S Jan 14, 2018 at 17:31 | |||||
| Jul 28, 2016 at 6:56 | vote | accept | user181822 | ||
| Jul 27, 2016 at 18:45 | answer | added | Luciano Andress Martini | timeline score: 10 | |
| Jul 27, 2016 at 18:44 | answer | added | Rahul | timeline score: 30 | |
| Jul 27, 2016 at 18:25 | comment | added | Wieland |
Replace your result = with result=$(($1 + $2)) and add echo $result after it and it works correctly, $1 and $2 are your functions arguments.
|
|
| Jul 27, 2016 at 18:22 | comment | added | user181822 | My example was horribly incomplete, I updated it a bunch. Now afaik it won't work anymore. | |
| Jul 27, 2016 at 18:21 | history | edited | user181822 | CC BY-SA 3.0 |
added 79 characters in body
|
| Jul 27, 2016 at 18:18 | comment | added | Wieland |
Using $1 and $2 in your example add function "works". Try echo $1 and echo $2 in it.
|
|
| Jul 27, 2016 at 18:14 | review | First posts | |||
| Jul 27, 2016 at 18:19 | |||||
| Jul 27, 2016 at 18:11 | history | asked | user181822 | CC BY-SA 3.0 |