Bash Scripting - Functions
How can you capture the text output of a bash function
greet that uses echo inside, and store it in a variable msg?greet that uses echo inside, and store it in a variable msg?echo, use command substitution: $(function_name).msg=$(greet) runs greet and stores its echo output in msg. Other options misuse return or echo.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions