FAQ
Anyone know if this is possible with GNU screen?

I would like to have a macro or keyboard shortcut whereby the
following actions are performed:

1. Open new screen window (CTRL-A C)
2. ssh to some $host
3. Rename current screen as $host (CTRL-A A $host)

I can see that typing "screen" while within a screen session opens a
new window, however I'm not clear on how to automate steps 2 and 3.

Search Discussions

  • Don Harper at Feb 23, 2009 at 5:53 pm
    Under bash, I have a function defined like so:
    function ss () {
    screen -t $1 ssh $*
    }

    Then, I simply type:
    ss hostname

    If I need to pass any options, then I simply stick it on the end, and
    the resulting screen window is named the hostname. If you do not want
    the fqdn, then use the .ssh/config file to set up aliases using the
    Host/Hostname.

    Don

    On Mon, Feb 23, 2009 at 10:31:25AM -0600, Sean Carolan wrote to To CentOS mailing list:
    Anyone know if this is possible with GNU screen?
    I would like to have a macro or keyboard shortcut whereby the
    following actions are performed:
    1. Open new screen window (CTRL-A C)
    2. ssh to some $host
    3. Rename current screen as $host (CTRL-A A $host)
    I can see that typing "screen" while within a screen session opens a
    new window, however I'm not clear on how to automate steps 2 and 3.
    _______________________________________________
    CentOS mailing list
    CentOS at centos.org
    http://lists.centos.org/mailman/listinfo/centos
    --
    Don Harper, RHCE <duck at duckland.org> http://www.donaldharper.com/

    Before enlightenment chop wood and carry water. After enlightenment,
    chop wood and carry water. - Wu Li
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    Type: application/pgp-signature
    Size: 197 bytes
    Desc: not available
    Url : http://lists.centos.org/pipermail/centos/attachments/20090223/423112ad/attachment.bin
  • Sean Carolan at Feb 23, 2009 at 6:36 pm

    On Mon, Feb 23, 2009 at 11:53 AM, Don Harper wrote:
    Under bash, I have a function defined like so:
    function ss () {
    screen -t $1 ssh $*
    }

    Then, I simply type:
    ss hostname
    Nice, this is helpful. I used "ssc" instead because there appears to
    be a built in ss command.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedFeb 23, '09 at 4:31p
activeFeb 23, '09 at 6:36p
posts3
users2
websitecentos.org
irc#centos

2 users in discussion

Sean Carolan: 2 posts Don Harper: 1 post

People

Translate

site design / logo © 2022 Grokbase