Quote:
Originally Posted by 123an
case2: ssh -f <machine_ip> <cp file1 file2> <executable2>
Here, the executable in 'case 2' won't take command line arguments as in case of 'case 1', i.e. executable wil always read input arguments from file with name "args".
so what i tried here is i have created multiple text files with different arguments, during ssh i tried to copy these text files to file "args" and tried to execute "executable 2". But i am receving an error saying "Cannot fork into background without a command to execute.".
Can anybody suggest me the solution for this???
Thanks,
123an
|
Well, case2 appears to be (1) a copy and (2) a command to run. You can do this as if the entire set of commands were passed to "sh -c" as a single argument. That is, put the set of commands, separated by semi-colons (

in double (or single) quotes:
Code:
ssh root@fwlb2 "echo 1; echo 2"
The -f option makes no difference here.