LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-17-2004, 06:36 AM   #1
didi
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
netcat shell script


Hello,

I have a shell script on my linux. My font-end is on my windows machine in vb(.net) code

Shell script:
#!bin/sh

nc -l -p 1500
read login

echo "your login is: " $login
exit 0


Vb script:
tcpClient.Connect("192.168.0.1", 1500)
Dim nwStream As NetworkStream = tcpClient.GetStream()

Dim sendLogin As [Byte]() = Encoding.ASCII.GetBytes("test")
nwStream.Write(sendLogin, 0, sendLogin.Length)


The client connect to my server, I send the value 'test' to my serverscript, i see this value on my linux shell, but the script don't read it in my variable 'login'.

What's my fault? How can i do this?

Thanks to all.
 
Old 03-17-2004, 06:45 AM   #2
meldar
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Gentoo
Posts: 136

Rep: Reputation: 15
Try to use a pipe:

Code:
nc -l -p 1500 | read login
 
Old 03-17-2004, 07:44 AM   #3
didi
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks but it will not work. It's the same problem.
 
Old 03-17-2004, 10:27 AM   #4
meldar
Member
 
Registered: Feb 2004
Location: Denmark
Distribution: Gentoo
Posts: 136

Rep: Reputation: 15
Strange. It seems that read doesn't read from standard input. Try if you can find a flag that will do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
shell script with "netcat > file" at boottime trajjm Programming 3 10-10-2005 06:54 AM
Using Netcat through shell script zael Programming 1 05-22-2004 10:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration