|
Re: Eclipse Input Output Redirection with < and > [message #1781590 is a reply to message #1781568] |
Fri, 09 February 2018 04:20 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Eclipse launches the command as a new process without using a shell.
You probably should execute a shell command that then executes your program
Under Linux, the following run configuration (note the command and arguments are in separate tabs):
/usr/bin/bash -c "pwd; echo 'pstree -a -s $$' > tmp; bash -p < tmp"
produces
/home/dvavra/proj/HCP-FANN
systemd --switched-root --system --deserialize 23
└─lightdm
└─lightdm --session-child 12 19
└─sh /etc/xdg/xfce4/xinitrc -- vt
└─xfce4-session
└─xfce4-panel --display :0.0 --sm-client-id 26f5d9e4b-868b-48f5-a436-a94ab1f73c5b
└─eclipse
└─java -Dosgi.requiredJavaVersion=1.8 -Dosgi.instance.area.default=@user.home/eclipse-workspace ...
└─bash -c pwd; echo 'pstree -a -s $$' > tmp; bash -p < tmp
└─bash -p
└─pstree -a -s 28855
Note that the first bash command (shown after java) is executed directly.
This double use of bash is only for illustration.
Executing bash -c 'pstree -s $$' causes the invocation of bash to vanish.
systemd --switched-root --system --deserialize 23
└─lightdm
└─lightdm --session-child 12 19
└─sh /etc/xdg/xfce4/xinitrc -- vt
└─xfce4-session
└─xfce4-panel --display :0.0 --sm-client-id 26f5d9e4b-868b-48f5-a436-a94ab1f73c5b
└─eclipse
└─java -Dosgi.requiredJavaVersion=1.8 -Dosgi.instance.area.default=@user.home/eclipse-workspace ...
└─pstree -a -s 29210
Under Windows you should execute cmd.exe /c "your command"
[Updated on: Fri, 09 February 2018 04:23] Report message to a moderator
|
|
|
Re: Eclipse Input Output Redirection with < and > [message #1783513 is a reply to message #1781590] |
Tue, 13 March 2018 18:38 |
Brian Chu Messages: 3 Registered: February 2018 |
Junior Member |
|
|
How do I do this within eclipse? Do I have to be doing this in terminal? Starting a new project and very confused. If it's too complicated, just let me know and I'll switch to Visual Studio. Is it even possible to do this within eclipse? Every IDE I've seen allows for io redirection, but I can't find any documentation or anything within eclipse that supports this. Also I'm very unfamiliar with shell...
[Updated on: Tue, 13 March 2018 18:43] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03520 seconds