Results 1 to 3 of 3

Thread: GNU screen in startup screen: multiple commands

  1. #1
    Join Date
    Sep 2006
    Beans
    156
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Question GNU screen in startup screen: multiple commands

    Greetings,
    I am searching for a way to run multiple commands at boot time using the gnu screen utility.

    A solution could be:
    screen -dm -t title1 command1
    screen -dm -t title2 command2
    .
    .
    .
    screen -dm -t titlen commandn

    but the result would be many sessions, each one with just one child. What I need is just one session with many children, one child per command.

    Can anybody help me?

    Thanks
    Last edited by MadeR; August 4th, 2010 at 11:23 AM. Reason: Spelling fix
    msn : mas_dero@hotmail.com; skype: masdero

  2. #2
    Join Date
    Mar 2008
    Location
    Cardiff, UK
    Beans
    425
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: GNU screen in startup screen: multiple commands

    Try this:

    Code:
    screen -dm -t title1 bash -c 'command1 ; command2 ; command3'
    This will run command1, command2 and command3 in sequence in one screen session.

  3. #3
    Join Date
    Feb 2010
    Location
    Silicon Valley
    Beans
    1,898
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: GNU screen in startup screen: multiple commands

    I think the OP wanted to run a single screen program with multiple internal "screens", each running a different program.

    Here's one way to do it. screen(1) has a "-c" option to provide a startup file instead of $HOME/.screenrc. And that startup file can start new internal screens.

    Example input file:
    Code:
    # Screen startup file to start multiple commands under multiple screens.
    # Start with "screen -c thisfilename"
    
    # Screen 0: Start 'top'
    # Screen 1: Start 'tail -F /var/log/syslog'
    
    screen -t top    0 top
    screen -t syslog 1 tail -F /var/log/syslog
    Save the above to a file, say "fancy.screenrc". Then start screen with:
    Code:
    screen -c fancy.screenrc

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •