mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-02 01:21:14 +00:00
Fixed macros (%u,%s,%h,%n) multiple replacements
This commit is contained in:
parent
ea8081ea91
commit
e9bb9ef34c
2 changed files with 8 additions and 5 deletions
3
Changes
3
Changes
|
@ -1,3 +1,6 @@
|
|||
????-??-?? Duncan Ferguson <duncan_ferguson@user.sf.net> - v4.02_02
|
||||
- Fixed macros (%u, %s, %h, %n) not doing multiple replacements
|
||||
|
||||
2013-04-16 Duncan Ferguson <duncan_ferguson@user.sf.net> - v4.02_01
|
||||
- Refactured file loading code
|
||||
- Add in 'tags' file handling
|
||||
|
|
|
@ -3,7 +3,7 @@ package App::ClusterSSH;
|
|||
use 5.008.004;
|
||||
use warnings;
|
||||
use strict;
|
||||
use version; our $VERSION = version->new('4.02_01');
|
||||
use version; our $VERSION = version->new('4.02_02');
|
||||
|
||||
use Carp;
|
||||
|
||||
|
@ -538,17 +538,17 @@ sub send_text($@) {
|
|||
{
|
||||
my $servername = $svr;
|
||||
$servername =~ s/\s+//;
|
||||
$text =~ s/%s/$servername/xsm;
|
||||
$text =~ s/%s/$servername/xsmg;
|
||||
}
|
||||
$text =~ s/%h/hostname()/xsme;
|
||||
$text =~ s/%h/hostname()/xsmeg;
|
||||
|
||||
# use connection username, else default to current username
|
||||
{
|
||||
my $username = $servers{$svr}{username};
|
||||
$username ||= getpwuid($UID);
|
||||
$text =~ s/%u/$username/xsm;
|
||||
$text =~ s/%u/$username/xsmg;
|
||||
}
|
||||
$text =~ s/%n/\n/xsm;
|
||||
$text =~ s/%n/\n/xsmg;
|
||||
|
||||
foreach my $char ( split( //, $text ) ) {
|
||||
next if ( !defined($char) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue