Issue
I have a bash function that produces some output:
function scan {
echo "output"
}
How can I assign this output to a variable?
ie. VAR=scan (of course this doesn't work - it makes VAR equal the string "scan")
Solution
VAR=$(scan)
Exactly the same way as for programs.
Answered By - Robert Obryk Answer Checked By - Gilberto Lyons (WPSolving Admin)