in reply to
Re^2: Command Executing problem in perl.
in thread Command Executing problem in perl.
Creating the file on the remote machine is not impossible, it's only a matter of quoting the string the right way.
In your case, it's also a matter of isolating that > sign you have inside your parameters, because otherwise it's interpreted by the remote shell as a redirection.
my @cmd = (
q['mminfo -q "savetime>3/1/12,name=DISASTER_RECOVERY:\\\\" -av -ot
+ -r client > /home/rbr/clnts']
you should get the result you expect. I assumed the \ after the colon is just one, because if you launch directly the command:
mminfo -q "savetime>3/1/12,name=DISASTER_RECOVERY:\\" \
-av -ot -r client >/home/rbr/clnts
from the shell, one of the \ is eaten by the shell. The four \\\\ should be equivalent. I tried this with a "mminfo" command that is just a script echoing its arguments, and this is what I get:
-q savetime>3/1/12,name=DISASTER_RECOVERY:\ -av -ot -r client
and it's written in a file on the remote machine.