Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-tm-dev] Avoid output from before a command was executed (Re: Advice reg. including RSE...)


I'm now using some code very similar to the snippet I got below (much thanks for that) with the addition of reading output with the simpleCommandOp.readLine(false) function.

This works fine in general. One problem I encountered though, is that the readline function returns all the stdout from the shell since logging in, which includes (for us) some 70 lines of welcome message(!).

Is it possible to only get the output from after the command was executed?

Best Regards
// Samuel

On 12/14/2010 06:24 PM, David McKnight wrote:
Hi Samuel,

I'm not sure how to get at those materials at the moment but here's a
short example of one way to use the shell, given an IRemoteFile:

IHost host = selectedFile.getHost();
IRemoteFile parentDirectory = selectedFile.getParentRemoteFile();
IRemoteCmdSubSystem cmdss = RemoteCommandHelpers./getCmdSubSystem/(host);
SimpleCommandOperation simpleCommandOp =
*new*SimpleCommandOperation(cmdss, parentDirectory,true);
simpleCommandOp.runCommand(cmd1, *true*);
} *catch*(Exception e) {
// *TODO*Auto-generated catch block

Note, that SimpleCommandOperation is a just wrapper utility for dealing
with shell commands. You don't have to use that but is one relatively
simple approach.

Hope that helps,
David McKnight
Phone: 905-413-3902 , T/L: 969-3902
Internet: dmcknigh@xxxxxxxxxx
Mail: D1/YFY/8200/TOR

Inactive hide details for Samuel Lampa ---14/12/2010 11:24:25 AM---What
we try to do, seem to have been documented in a tutoriaSamuel Lampa
---14/12/2010 11:24:25 AM---What we try to do, seem to have been
documented in a tutorial at EclipseCon 2008, of which the mate

Samuel Lampa <samuel.lampa.l@xxxxxxxxxx>


14/12/2010 11:24 AM

Re: [dsdp-tm-dev] Advice reg. including RSE with an Eclipse RCP application

Sent by:	


What we try to do, seem to have been documented in a tutorial at
EclipseCon 2008, of which the material has been linked here:

... but the links to the slides and other materials do no longer work.

Does anybody on the list have this material saved locally and could
share it? Otherwise, does anybody have something such as a code snippet
describing how to get started executing remote commands over SSH?

Best Regards
// Samuel

On 12/14/2010 02:40 PM, Samuel Lampa wrote:
 > To give a little bit of background, we are building a customized client
 > for access to a linux based high-performance computer center, to let
 > also let less computer-knowledgeable people (like biologists, working
 > with next-gen DNA-sequencing data) submit cluster jobs by providing
 > wizards that generate the actual command line commands to execute, etc.
 > What we want, is both to display the main views of RSE (like the file
 > explorer and the SSH console), and also want to programmatically allow
 > to execute actions via the SSH connection.

Samuel Lampa
Bioinformatician @ Uppsala University
dsdp-tm-dev mailing list

dsdp-tm-dev mailing list

Samuel Lampa
 Bioinformatician @ Uppsala University

Back to the top