i'm coding a simple bash script and i found this error syntax error at line XX `(' unexpected my code:
function myfun(){
echo XXXX
echo YYYY
read choice
}
choice=$(myfun)
where is the error. i used the ShellCheck and no errors were detected.