Re: [JSch-users] Re: Multiple commands and environment
Status: Alpha
Brought to you by:
ymnk
From: matthieu n. <mn...@gm...> - 2005-06-27 20:07:44
|
Thanks Kevin for your answer, I tried that : String commande =3D "ll\n";=20 byte[] bytes =3D commande.getBytes();=20 ByteArrayInputStream bais =3D new ByteArrayInputStream(bytes);=20 =20 But this works once and I'd like to send multiple commands. I don't know how to use a PipedInputStream. It might be the right solution. I will try that... Thanks a lot. Mat channel.setInputStream(bais);=20 On 6/27/05, Kevin Kane <ka...@um...> wrote: > matthieu nouvel wrote: > > To continue the subjet of Andrzej Taramina I have the same problem : > > sending multiple commands on the remote host keeping the > > environnement. > > Atsuhiko Yamanaka wrote in response : > > "You can use ChannelShell." > > But in the example script of shell, the ChannelShell is waiting for > > System.in to receive commands. >> channel.setInputStream(System.in); > > > > What should we do to send commands in other way than System.in which > > is wainting for keybord entries ? To send commands by String > > vrariables - for examples - from another part of the program. >=20 > I haven't had an occasion to use ChannelShell myself, but can't you set a > different InputStream? It seems like you could create an InputStream from > either a String/StringBuffer containing your commands, or from a > PipedInputStream where you are writing to the corresponding PipedOutputSt= ream. >=20 > -Kevin >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclic= k > _______________________________________________ > JSch-users mailing list > JSc...@li... > https://lists.sourceforge.net/lists/listinfo/jsch-users > |