Nguyễn Pháp
New member
How do you return an array in bash?
Answer
This approach involves the following three steps:
Answer
This approach involves the following three steps:
- Convert the array with ‘declare -p’ and save the output in a variable. …
- Use the echo builtin to pass the variable to a function or to pass it back from there. …
- Finally, recreate the array where it is passed to using the eval and the ‘declare -a’ builtins.