If I execute it, this is the output:
The third command does not run and the program stops at the end of the second command!! Why?? It's a SSH question??
Thanks a lot!!
It looks to me like you are being logged into the remote host and it is leaving you at the prompt. If you type exit at the prompt does 'control' then return to your programme, or if you type hostname at the prompt is the output the hostname of 192.168.1.100 rather than the host that is running your programme?
I agree with Corona688, if your intent is to execute cmd on the remote host, then it needs to go before the semicolon. Depending on what your C++ programme is doing, especially with regard to standard input, you need to be careful with using ssh in this manner. If you are executing a remote command, not wanting to log in and have a prompt, then you might consider using the -n option on the ssh command to prevent it from reading standard input. You might also have issues if ssh finds the need to prompt for a password.
---------- Post updated at 22:38 ---------- Previous update was at 22:36 ----------
Looks like we crossed posts -- scratch what I said as you've explained.
Unfortunately, my windows experience is next to zero. From what I remember about cmd (from DOS 3.x days) I don't think you can give it a command to execute like a unix shell (ksh -c "command string"). Maybe someone else will chime in; sorry.
"cmd" command is necessary to launch one application in windows!! If I don't use "cmd" I can't launch any application, but only work with files!! I don't know why!!!
I haven't problem with password because I use the authentication with asymmetric key!!
How I can use the "-n" option??? For example, if I would launch the command "dir" (like "ls" in Unix) after "cmd" how can I do??
don't work!!
Any suggestion, please??
Thanks very very much!!
---------- Post updated at 06:00 AM ---------- Previous update was at 05:02 AM ----------
Cannot present unpresented disks back again. On a test server tried this as a solution "multipath -r" and it worked. Too worried to try it in production before I know all the information.
Any info would be appreciated!
Also some links to the documentation on this specific issue could help a... (1 Reply)
Hello experts!
I need your help please
I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.:
2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well.
So I want to execute
date -d '2016-11-25 03:14:50' ... (2 Replies)
I have once experienced this problem without understanding what caused it but now learned thatn there is even a PMR dealing with it. Sometimes it happens that you encounter the following (rather cryptical) error message when trying to install an rpm-package:
package <rpm_package_name> is for a... (1 Reply)
Hi all,
i face an error related to my server ""it's running server"" when i use sqlplus command
$ sqlplus
bash: sqlplus: command not found
the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup.
i already check the directory... (4 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello!!!
I'm trying to pass the output from bash command to perl variable in a perl script, and I used the "system" command to execute the bash statment and pass the result to perl string variable, in this perl script I used a variable $file that store data for using it as a regular expression.... (2 Replies)
I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank).
In a first approach I coded:
find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt
But this doesn't work. I got an error (under Ubuntu):
grep:... (5 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
I am having an issue with using sockets.
I have a program which binds to a socket and listen on it. Later I spawn a thread to handle some function. In the new thread created I need to call a shell script which executes the specified function. Here I am using a system command to call the... (5 Replies)
Hi All,
I am trying to schedule a one time job using the at command with the help of shell script for my project. The shell script should take a parameter as a command line argument from the at command itself. Is it possible to take a command line parameter for a shell script in the command... (3 Replies)