Similar to this: Return last command executed in shell-script.
lastCommand=$(some command here)
Is it possible to achieve same result, but instead used inside a bash function, not a bash script?
P.S.
lastCommand
mean previous command inside the function.
Bash 4.2+ solution suffices.