Skip to content

Instantly share code, notes, and snippets.

@mamemomonga
Last active December 14, 2015 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamemomonga/5063274 to your computer and use it in GitHub Desktop.
Save mamemomonga/5063274 to your computer and use it in GitHub Desktop.
gnu screenを使用しているときに、別のウィンドウでssh接続。
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
binmode(STDIN,':utf8');
binmode(STDOUT,':utf8');
if($#ARGV==-1) {
print "USAGE: $0 [title] [ssh command]\n";
print " $0 [ssh command])\n";
exit;
}
my ($title,@cmd);
if($#ARGV==0) {
$title=$ARGV[0];
$title=~s/^(.+?)\@//;
} else {
$title=shift @ARGV;
}
system('screen','-t',$title,'ssh',@ARGV);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment