LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-30-2012, 10:23 PM   #1
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Rep: Reputation: 0
sending commands to a screen


I have a screen I use for my minecraft server so it is a java file running and it doesn't totally act like a terminal (I think). So give me what you got and I'll try it. I need to be able to send a command like stop to a screen called PhantasyCraft. the last time I did this though it sent the whole screen -argument and blah blah blah to the terminal and said it wasn't valid (Minecraft said it wasn't not the operating system). so it's not just sending stop it's sending something else with it too which is making it not work.
also just to make sure we have an understanding this screen isn't attached and nor do i want to attach it to run some commands. thanks

Last edited by fatalerror0x00; 10-31-2012 at 12:17 AM. Reason: Forgot a specific detail
 
Old 10-30-2012, 11:15 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

please define what you mean by "screen". A physical display, an xterm, "gnu screen" etc.? If you are unable to tell us what a "screen" is, please be very explicit about what you are doing.

Evo2.
 
Old 10-31-2012, 12:15 AM   #3
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Original Poster
Rep: Reputation: 0
Well I would have assumed youd know i was talking about the screen command from the details I gave so it's not enough but I mean when you use the command screen to run programs in (used more commmonly with ssh since you don't have tty's in ssh (as far as I know) :P
 
Old 10-31-2012, 12:39 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

ok, so you are talking about GNU screen. How exactly are you trying so send the command? Eg do you do something like
Code:
screen -S sessionname -p 0 -X somecommand
?
Exact commands and error messages would be useful.

Evo2.
 
Old 10-31-2012, 01:01 AM   #5
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Original Poster
Rep: Reputation: 0
screen -S sessionname -p 0 -X somecommand <- that syntax does nothing when I replace sessionname with the name of my session (PhantasyCraft) and somecommand with stop which is the command I would like to send the screens "terminal" I put that in quotes because I'm not sure what it is as you can't do ls rm mv cp df mkdir touch and commands like that in this terminal because a java file is running and made it's own sort of terminal it seems
 
Old 10-31-2012, 01:34 AM   #6
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Original Poster
Rep: Reputation: 0
I figured out a way to do it now it's been infront of me kinda all along I just idk what happened but it works now and I know what to do thanks guys
 
Old 10-31-2012, 12:04 PM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Please post what worked for you, so that others searching through threads can find your solution.
 
Old 10-31-2012, 01:47 PM   #8
fatalerror0x00
Member
 
Registered: Oct 2012
Location: Holden, ME, USA
Distribution: SlackWare64 14.00
Posts: 185

Original Poster
Rep: Reputation: 0
Right sorry :P I did

screen -S PhantasyCraft -X stuff "command^M"

^M can be gotten by typing it in manually or pressing control + V then control + M

Commmand is replaced with the command you want to send to the screen in my case stop is the command.

^M is like pressing enter so that it doens't just send the text to it but also runs the command

Hope this helps anyone that looks at this and needs this solution
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sending commands to GNU Screen to be *sourced*, not subshelled jgombos Linux - Software 3 06-02-2011 10:45 AM
Sending commands to a screen session owned by root. Rendman Linux - Software 3 01-28-2011 01:34 AM
Sending commands to a screen session tirwit Linux - Software 6 08-08-2010 09:46 PM
Sending HP Printer Commands cmnorton Programming 2 12-10-2007 07:58 AM
sending at commands over pppoe? sti2envy Linux - Networking 3 10-18-2005 06:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration