rsh command is removing the double quotes in the remote shell.
For example: my command rsh 10.20.1.25 my_pgm -g "NAME1 NAME2" In remote shell my_pgm -g NAME1 NAME2
I want double quotes for -g option in remote shell too. Any idea?
rsh command is removing the double quotes in the remote shell.
For example: my command rsh 10.20.1.25 my_pgm -g "NAME1 NAME2" In remote shell my_pgm -g NAME1 NAME2
I want double quotes for -g option in remote shell too. Any idea?
Copyright © 2021 Jogjafile Inc.
To escape double quote inside a string use a backslash:
Ok, you mean using
system(), see output onecho:Translated to yours (Note single quote and double quote around NAME1 NAME2):
sprintf(cmd_string, "rsh 10.20.1.25 my_pgm -g '\"NAME1 NAME2\"'");Or as pointed out by @nos: