Complicating issues, the code is run on the sequencer, which I (rightly) do not have root privileges for. I took the output from the machine (thanks, SSHFS) and used this code to get human-readable output.
#!/usr/bin/perl
use Modern::Perl ;
use Number::Bytes::Human qw(format_bytes) ;
while ( my $a = <STDIN> ) {
$a =~ s{\b(\d+)\b}{ format_bytes( $1 ) }egmx ;
say $a ;
}
I love filters. So easy. And
Number::Bytes::Human
kept me from having to write my own code to convert. Yay, CPAN!
No comments:
Post a Comment