Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am stucked thinking to send data to the SSH linux script while it is running in plink with vb.net.

I am able to get the output & surely able to execute the SSH linux script with standardiput.writeline and standardoutput.readline.

But, the problem is that the SSH linux script need user input y/n during the script execution. I saw some examples but mostly on Linux programming that preset the input. But, I cannot preset the input. I need user to define y/n.

I tried standardinput.writeline("y") but, this command doesn't looks like doing what I want. Any suggestion please?

Thanks!

share|improve this question
    
If standardinput.writeline works for you for entering command on command prompt, it should work equally for answering the question. What does happen when you do the standardinput.writeline("y")? –  Martin Prikryl Apr 29 '13 at 15:11
    
I had actually feeding the output to a textbox and I notice something like this: Does the display turn off? [y/n] y. You see that with the standardinput.writeline("y") had actually input a "y" there or probably not. But, it is surely not merely a "y". Because after the standardinput.writeline("y"), the .sh ended with result as if a "n" or something else is entered and not a "y". –  yun May 13 '13 at 15:27
    
@MartinPrikryl, can you please help me on this? I don't have any idea at all about this... –  yun May 17 '13 at 17:21
    
What do you mean by "textbox"? That sound ike a GUI, not a terminal prompt. Can you include a sample of the console/terminal display in your question? –  Martin Prikryl May 20 '13 at 9:10
    
@MartinPrikryl Because I will input the "y" or "n" only when the .sh question arose. So, I am checking the output with StandardOutput.ReadLine(). Rather than using writeline, I try to input two times with standardinput.write("y") then follows by standardinput.write(vbLf). I think problem comes with the "enter" - I tried cr, lf & crLf but none works. .sh will immediately end right after the "enter" –  yun May 25 '13 at 1:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.