Bash functions, unlike functions in most programming languages do not allow you to return a value to the caller. When a bash function ends its return value is its status: zero for success, non-zero for failure. To return values, you can set a global variable with the result, or use command substitution, or you can pass in the name of a variable to use as the result variable.
Read more »Returning Values from Bash Functions
http://www.linuxjournal.com –
Created by keyboardninja 15 years 3 weeks ago – Made popular 15 years 3 weeks ago
Category: High End Tags:
Category: High End Tags: