LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2007, 04:09 AM   #1
Frits of waterplant
LQ Newbie
 
Registered: Jun 2005
Location: Rotterdam, Netherlands
Distribution: Debian Etch
Posts: 6

Rep: Reputation: 0
Creating a screen session in an existing session


Hi,

You can create in a existing screen session a second window by pressing CTRL-A C, but how can you do that from command line?
 
Old 01-13-2007, 04:25 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
ctrl-a c uses GNU Screen

"man screen"
screen [ -options ] [ cmd [ args ] ]

Also see article:
http://www.debian-administration.org/articles/34/print

Last edited by Simon Bridge; 01-13-2007 at 04:27 AM.
 
Old 01-13-2007, 05:06 AM   #3
Frits of waterplant
LQ Newbie
 
Registered: Jun 2005
Location: Rotterdam, Netherlands
Distribution: Debian Etch
Posts: 6

Original Poster
Rep: Reputation: 0
I think you misunderstood.

I would like to create a new GNU screen window in an existing GNU screen session from the command line, in stead of reattaching the existing screen session and pressing CTRL-A C.

If I start a second application in screen now, it will exist in a second session. So if you would execute

Code:
screen -ls
you would get as output:

Code:
There are several suitable screens on:
        3460.pts-0.vissekom     (Detached)
        3473.pts-0.vissekom     (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
I would like to have the two application running in the same session, as two windows. But I start these applications from a script. So I can't use any command keys to do it.
 
Old 01-18-2007, 01:56 AM   #4
Frits of waterplant
LQ Newbie
 
Registered: Jun 2005
Location: Rotterdam, Netherlands
Distribution: Debian Etch
Posts: 6

Original Poster
Rep: Reputation: 0
Anybody???
 
Old 01-18-2007, 04:53 AM   #5
bospaadje
LQ Newbie
 
Registered: Jan 2007
Location: Netherlands
Distribution: gentoo linux
Posts: 6

Rep: Reputation: 0
i found the following section in the man page for screen:
Quote:
Originally Posted by man screen
"Thus,
if your ".screenrc" contains the lines

# example for .screenrc:
screen 1
screen -fn -t foobar -L 2 telnet foobar

screen creates a shell window (in window #1) and a window with a
TELNET connection to the machine foobar (with no flow-control
using the title "foobar" in window #2) and will write a logfile
("screenlog.2") of the telnet session."
This is documented under the 'screen' option, section 'Customization'. You can create a separate configuration file for your script and specify it with the screen -c file option. Judging from the manpage it's probably not possible to do this directly from the commandline, except by creating the conf file from the script using, for example,
Code:
echo "screen 1 some_command" > /folder/screenconf_script
echo "screen 2 some_other_command" >> /folder/screenconf_script
etc..

screen -c /folder/screenconf_script
and removing the file again at the end of the script.

I hope this helps you solve your problem.
 
  


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
Connecting to existing session w/ FREENX Ashrack Linux - Networking 0 07-02-2006 10:02 AM
creating tr fields according to session values? ati Programming 6 05-09-2006 03:45 PM
connecting to an existing session arichardson Fedora 1 11-21-2005 12:33 PM
xfce4-session fails to save session ! OneManArmy Debian 0 12-10-2004 02:14 PM
Connect to Existing X Session Guru3 Red Hat 1 01-06-2004 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:40 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