I need to execute a command with escaped argument(s) using sh -c. I know the string looks pretty ugly but simple ones don't cause a problem.
The output of the echo when passed to sh -c is different then when run stand alone and I am struggling to figure out how to fix it.
Background:  I am escaping the arguments to the echo command since this is passed in and I wanted to make sure extra command were not inserted.  I am using sh -c as I wanted to have the ability to use shell facilities like | or nohup etc..  Probably not relevant but this is being run through an ssh connection to a remote server.
The command and output of the sh -c command is:
sh -c "echo \a\\\\\b\;\c" ;c
The command and output of the stand alone command is:
echo \a\\\\\b\;\c a\\b;c
Any help would be much appreciated!