-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Currently, there are three functions put, get, and keys in the script.
Each of them ends up mutating global state, which probably isn't a good idea in the long term. You can make your functions more "pure" by using command substitution:
function myfunc()
{
local myresult='some value'
echo "$myresult"
}
result=$(myfunc) # or result=`myfunc`
echo $resultThe function keys is probably the most problematic as you're creating a function and a global variable with the same name.
Metadata
Metadata
Assignees
Labels
No labels