How do we get/save final command line string accepted and executed by bash right after doing eval
very hard to explain, so really helps when xtrace is on, e.g:
$ cmd=ls; f=package.o ; eval $cmd $f
+ cmd=ls
+ f=package.o
+ eval ls package.o
++ ls package.o
package.o
We see xtrace print out 2nd last string (having dropped prefix ++):
ls package.o
which must be in a Bash variable
You could redefine eval
to save its arguments:
eval(){
eval_args=("$@")
builtin eval "$@"
}