I'm building an enumeration script that has a list of commands to run such as:
hostname whoami uid etc...
I want to output to the screen the command being run, but due to variable expansion, it gets substituted to the actual command and bash proceeds to execute it.
So the desired effect is to have a line in the script such as:
echo Currently Running: [$cmd]
and have that echo out to the screen:
Currently Running [whoami]
Currently running [root]
How does one escape the command but still get expansion to stdout?