[Gambas-user] little question abour shell commands

Rob sourceforge-raindog2 at ...94...
Fri Jan 2 18:39:54 CET 2004


On Friday 02 January 2004 12:26, Olivier Coquet wrote:
> how to do this because after telnet launched in the shell, i
> must send it some other command like open...... and login

For telnet in particular you should probably start looking into 
the gb.net component which will be a little easier to deal with.  
But you want to do something like:

public TelnetProc as Process
...
shell "telnet" for read write as TelnetProc
...
print #TelnetProc, "open somehost\n"

The rest of your stuff you will need to do in conjunction with 
the Process_Read (formerly Process_Write) event, as a state 
machine.  To wit:

public sun Process_Read()
	dim in$ as String
	line input #TelnetProc, in$
	if instr(in$, "login:") > 0 then
		' do some login stuff
	elseif instr(in$, "Password:") > 0 then
		' send password
...
etc.

Sorry for the pseudo code, I'm home sick and am a little fuzzy 
headed ;)

Rob





More information about the User mailing list