Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Redirect std out inside console
Redirect std out inside console [message #965698] Wed, 31 October 2012 12:48 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
When executing a command inside the osgi console, I would like std out to be redirected to a file.
Is that supported somehow?

For instance

osgi> ss


will list the state of all bundles.

I would like to redirect its output to a file inside the console itself (output of ss was just an example, I think of more complex third-parties commands).
Re: Redirect std out inside console [message #966695 is a reply to message #965698] Thu, 01 November 2012 06:36 Go to previous messageGo to next message
Lazar Kirchev is currently offline Lazar KirchevFriend
Messages: 28
Registered: July 2009
Location: Sofia, Bulgaria
Junior Member
Hi,

If you are using Equinox 3.8/Eclipse 4.2, you could try piping to the tac command:

osgi> ss | tac <filename>

You can get a description of this command with "tac -?" or "tac --help".

HTH
Lazar
Re: Redirect std out inside console [message #966716 is a reply to message #966695] Thu, 01 November 2012 07:00 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
Great, thanks, that works!

I had to provide a valid/full URI (e.g. file:///d:/tmp/out.txt), but it is ok.

I guess, stdin/stderr are supported in a similar way?

Lazar Kirchev wrote on Thu, 01 November 2012 02:36
Hi,

If you are using Equinox 3.8/Eclipse 4.2, you could try piping to the tac command:

osgi> ss | tac <filename>

You can get a description of this command with "tac -?" or "tac --help".

HTH
Lazar

Previous Topic:Equinox and Declarative Services Annotations
Next Topic:Log4j in eclipse 4 application
Goto Forum:
  


Current Time: Fri Dec 19 04:42:49 GMT 2014

Powered by FUDForum. Page generated in 0.01512 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software