#!/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 $_"; } }
In reply to How to pass variable to Net::OpenSSH method by urello
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |