.OS invocation within macro , with dynamic command text

Tools & Utilities
Enthusiast

.OS invocation within macro , with dynamic command text

Problem statement: Calling OS command from a Macro , with dynamic framed text.
Basic solution : ECHO '.OS static command syntax';

Requirement : Is there a way to provide input parameters to the OS command from inside a macro ?
E.g : ls .

Here I wish to execute the macro by providing dirname as an input variable and then use it while invoking the .OS command .

Any pointers to the possible usage will be really helpful.