[
https://issues.jboss.org/browse/FORGE-670?page=com.atlassian.jira.plugin....
]
Ivan St. Ivanov commented on FORGE-670:
---------------------------------------
OK, I touched this as well :-)
Maybe some hints would be helpful.
So, FSHParser::captureLogicalStatement is the place, where we may detect that a redirect
was issued. So there is maybe the place to somehow tell the LogicalStatement to redirect
its output somewhere else. Just speculating...
Next, I see also that there is a PipeOut interface that is passed around all the methods
in the trace. But it is usually null and is never used inside
org.jboss.forge.shell.command.Execution::perform. I see that this interface has just one
implementation (org.jboss.forge.shell.util.PipeOutImpl), which uses the shell as output.
However, the fact that it is never used inside Execution::perform makes me wonder whether
creating a new implementation of PipeOut (RedirectPipeOutImpl for example) and passing it
to that method would work at all.
Can someone open my eyes for this Forge internals? :-)
Thanks!
Ivan
Redirect command output to a file
---------------------------------
Key: FORGE-670
URL:
https://issues.jboss.org/browse/FORGE-670
Project: Forge
Issue Type: Feature Request
Components: Shell
Reporter: George Gastaldi
Fix For: 1.0.7.Final
It should be possible to redirect output in shell to a file, so that the following
command should work:
{code}
cat
http://www.google.com > testme.txt
{code}
To append to the end of the file, use:
{code}
cat
http://www.google.com >> testme.txt
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira