Results 1 to 5 of 5
Hi!
I'm currently writing a C++ application to manage some screen functions in Debian(server).
However this issue have bothered me for 2 days now...
What I want to do is ...
- 04-05-2011 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 4
Send enter command to screen?
Hi!

I'm currently writing a C++ application to manage some screen functions in Debian(server).
However this issue have bothered me for 2 days now...
What I want to do is to send a command to an attached screen which is running.
Used the following command:
So I send a command with the -X parameter, which works just fine...Code:screen -S screenwindow
The command I want to send is "yes" and it does appear in my screen window when I attach it.Code:screen -S screenwindow -X stuff yes
But the problem is that I need it to submit it... well I need to press "enter" and I've been looking everywhere on how to do that.
Because right now it hangs on a line like this:
Obviously I could just press enter myself, but the problem is that it's running as a deamon and but it is supposed to do this all by itselfCode:Something here, do you want bla bla: yes
.
So are there any way I can submit it?
Thanks
- realchamp.
- 04-05-2011 #2
Try this:
$'\012' means "newline character".Code:screen -S screenwindow -X stuff $'\012'
DISTRO=Arch
Registered Linux User #388732
- 04-06-2011 #3Just Joined!
- Join Date
- Jun 2010
- Posts
- 4
- 04-06-2011 #4
i would send a carriage return (\r), and maybe even followed by a new line (\r\n)
I'm not sure what the corresponding value is with regards to what cabhan posted earlier
- 05-01-2011 #5Just Joined!
- Join Date
- Jun 2010
- Posts
- 4


Reply With Quote
