How to run complex Linux commands with core.local module?

Hi All,
Could you please let me know how to run complex Linux commands with core.local module?

I am running “st2 run core.local cmd=“echo Hello,Ramesh | awk -F’,’ ‘{print $2}’”” but it is not giving the expected output.
$ st2 run core.local cmd=“echo Hello,Ramesh | awk -F’,’ ‘{print $2}’”
2021-08-06 10:19:12,958 WARNING - Locale unknown with encoding unknown which is not UTF-8 is used. This means that some functionality which relies on outputting unicode characters won’t work. You are encouraged to use UTF-8 locale by setting LC_ALL environment variable to en_US.UTF-8 or similar.
.
id: 610d0ca1c220628e1bbe0216
action.ref: core.local
context.user: st2admin
parameters:
cmd: echo Hello,Ramesh | awk -F’,’ ‘{print }’
status: succeeded
start_timestamp: Fri, 06 Aug 2021 10:19:13 UTC
end_timestamp: Fri, 06 Aug 2021 10:19:13 UTC
result:
failed: false
return_code: 0
stderr: ‘’
stdout: Hello,Ramesh
succeeded: true

Thanks and Regards,
Ramesh

The output looks correct to me.

The command run from bash

Hello,Ramesh

Stackstorm result
stdout: Hello,Ramesh

I think the problem is the $ is a special character, so they wanted to run:

echo Hello,Ramesh | awk -F’,’ ‘{print $2}’

but if you look stackstorm ran:

echo Hello,Ramesh | awk -F’,’ ‘{print }’

You’ll need to escape the $ in the command - I can never remember if you will need one \ or two \, depends on when escapging is done.
But try running command:
echo Hello,Ramesh | awk -F’,’ ‘{print \$2 }’

Thank you @amanda11 and @Carlos for your quick response.