LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-23-2008, 02:16 PM   #1
xeross
Member
 
Registered: Apr 2008
Location: The Netherlands
Distribution: Debian 4.0
Posts: 48

Rep: Reputation: 15
Screen Commands


Hey,

I need some help with screen i need to know how to do the following(from outside screen)

1. create a detached screen session.
2. execute a command in the first window of that screen session
3. execute a command in the second window of that screen session
4. stop the progress in the first window of the screen session just like if you would press ctrl+c
5. stop the progress in the second window of the screen session just like if you would press ctrl+c
6. Exit the screen session

Thanks for your time, Xeross
 
Old 07-23-2008, 02:37 PM   #2
clint1986
LQ Newbie
 
Registered: Jul 2008
Location: Devon, United Kingdom
Distribution: Debian
Posts: 24

Rep: Reputation: 15
You can find all the information you need by reading the man pages for Screen. At the console, do the following:

Code:
man screen
It's all in there and it's explained really well. Come back if you have any trouble. Good luck. :)

Last edited by clint1986; 07-23-2008 at 02:39 PM.
 
Old 07-23-2008, 02:55 PM   #3
xeross
Member
 
Registered: Apr 2008
Location: The Netherlands
Distribution: Debian 4.0
Posts: 48

Original Poster
Rep: Reputation: 15
Already tried some commands but they didnt work.
 
Old 07-23-2008, 03:25 PM   #4
clint1986
LQ Newbie
 
Registered: Jul 2008
Location: Devon, United Kingdom
Distribution: Debian
Posts: 24

Rep: Reputation: 15
What did you try? What happened when you tried?

In answer to your first question, I think you need to run Screen with the -d -m parameters. For example:

Code:
screen -d -m
The above would start a Screen session but not attach to it. Then you would do this:

Code:
screen -r
And you would find yourself in that Screen session you just made. Using -d -m is good for startup scripts. You can have Screen load Irssi (an IRC client) in the background and then you attach to to when ready later on. For example:

Code:
screen -d -m irssi
In answer to your second question, to run a command straight away in Screen, just type the command right after the screen command. For example:

Code:
screen nano /etc/hosts
The above would start a screen session running the Nano editor with the /etc/hosts/ file open and ready for editing.

Hopefully that should get you going in the right direction. Peace. :)

Last edited by clint1986; 07-23-2008 at 03:28 PM.
 
Old 07-23-2008, 03:37 PM   #5
xeross
Member
 
Registered: Apr 2008
Location: The Netherlands
Distribution: Debian 4.0
Posts: 48

Original Poster
Rep: Reputation: 15
Ye i figured it out till there but i dont want multiple sessions i want a session created with the
Code:
screen -d -m
and then in that session create a second window and execute something in both windows from outside screen
 
Old 07-23-2008, 03:57 PM   #6
clint1986
LQ Newbie
 
Registered: Jul 2008
Location: Devon, United Kingdom
Distribution: Debian
Posts: 24

Rep: Reputation: 15
I'm not sure what you are trying to do but I'm pretty sure it goes beyond my expertise with Screen. You will need to wait until someone more experienced comes along to help you, or poke around the man pages a little more.

I'm pretty tired here and need to rest, otherwise I'd have a go figuring it out myself. Sorry. :(

Last edited by clint1986; 07-23-2008 at 04:04 PM.
 
Old 07-24-2008, 05:29 AM   #7
xeross
Member
 
Registered: Apr 2008
Location: The Netherlands
Distribution: Debian 4.0
Posts: 48

Original Poster
Rep: Reputation: 15
ok here's what i got

Code:
# Go to the correct directory(Normaly you could put the full path in the sudo command but not with this 

program)
cd /home/WoW/Silvermoon/bin

# Create a new detached screen session called BGSession
screen -S BGSession -d -m

# Start the logonserver on the first page
screen -r BGSession -p 0 -X sudo -u wow ./arcemu-logonserver

# Start the worldserver on the second page
screen -r BGSession -p 1 -X sudo -u wow ./arcemu-world
the creation works fine but the logonserver nor the worldserver starts
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 06:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 06:53 AM
Gnu Screen Commands PatrickNew Linux - Software 2 12-15-2006 05:23 PM
Suse Linux Commands For These Aix Commands? Vaskar Guha Linux - Software 2 12-19-2005 12:45 AM
Mandrake Commands like print screen etc.. lava Linux - General 3 06-11-2003 03:38 AM


All times are GMT -5. The time now is 05:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration