urello has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Net::OpenSSH; my $host = $ARGV[0]; my $ssh2 = Net::OpenSSH->new($host,user=>'root',timeout=>600); my @usernames = $ssh2->capture("du -s /var/lib/mysql/* |sort -nrk1 |aw +k -F'[\t_/]' '{if(\$1 > 100000) print \$(NF-1)}' |sort -u |grep -v 'm +ysql'"); foreach my $tempo (@usernames) { my @domains = $ssh2->capture("grep $tempo /etc/userdomains|cut + -d: -f1"); #THIS IS NOT WORKING SINCE $TEMPO IS NOT DEFINED IN SHELL foreach (@domains) { print "TEST $_"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to pass variable to Net::OpenSSH method
by hdb (Monsignor) on Apr 22, 2015 at 08:00 UTC | |
|
Re: How to pass variable to Net::OpenSSH method
by salva (Canon) on Apr 22, 2015 at 07:25 UTC |