| 1 | #!/usr/bin/perl -w | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use Linux::Mounts; | ||
| 5 | |||
| 6 | my $mtd = Linux::Mounts->new(); | ||
| 7 | my $list = $mtd->list_mounts(); | ||
| 8 | |||
| 9 | print "Number of mounted file systems : ", $mtd->num_mounts(), "\n\n"; | ||
| 10 | |||
| 11 | print "List of mounted file systems :\n"; | ||
| 12 | for ( my $i = 0; $i < $mtd->num_mounts(); $i++ ) { | ||
| 13 | for ( my $j = 0; $j < $#{ $list }; $j++ ) { | ||
| 14 | printf ("%-15s", $list->[$i][$j]); | ||
| 15 | } | ||
| 16 | print "\n"; | ||
| 17 | } | ||
| 18 | |||
| 19 | # or simplier ... | ||
| 20 | |||
| 21 | print "\nList of mounted file systems :\n"; | ||
| 22 | $mtd->show_mount(); | ||
| 23 |