Last active
December 14, 2015 09:09
-
-
Save mamemomonga/5063274 to your computer and use it in GitHub Desktop.
gnu screenを使用しているときに、別のウィンドウでssh接続。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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