I want to ask if it is possible to pass arguments to a script function by reference:
i.e. to do something that would look like this in C++:
This is what works for me on Ubuntu bash shell
#!/bin/sh iteration=10 increment_count() { local i i=$(($1+1)) eval ${1}=\$i } increment_count iteration echo $iteration #prints 11 increment_count iteration echo $iteration #prints 12