regex help on unix df

前端 未结 7 1914
耶瑟儿~
耶瑟儿~ 2020-12-02 01:22

I need some help tweaking my code to look for another attribute in this unix df output:

Ex.

Filesystem     Size    Used   Avail Capacity         


        
7条回答
  •  情歌与酒
    2020-12-02 01:48

    foreach my $device ( @df ) {
        next unless $device =~ m{^/};
        my( $filesystem, $size, $used, $avail, $cap, $mounted ) = split /\s+/, $device;
        # you take it from there.... ;)
    }
    

提交回复
热议问题