I want this output as...
0148G /home 775
--------------------------------------------------------------------------------
I am able to make this command and its working on terminal but I want to use this command in perl script and want to run in multiple server....
The bllow command line also look ugly and I am sure there is some better way to do this......
printf "%s\t" \
$(df | awk '/\/home/ { print $1,$5}') \
$(for T in a U G ; do stat --format=%$T /home ; done)
You would call it from perlscript like this:
my $file = $ARGV[0];
open SLIST, $file or die $!;
my @allserver = (<SLIST>);
foreach my $server (@allserver){
chomp($server);
`ssh $server "printf '%s\t' \\\$(df | awk '/\\/home/ { print \\\$1,\\\$5}') \\\$(for T in a U G ; do stat --format=%\\\$T /home ; done)" > $server`;
}