aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/vmware2/files/df
blob: b9db0532e0134a4b2fd83cc1f2f3927e2743b70d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
# Hacky emulation of GNU df.
# Intented to use with vmware wizard.
# Depend from the _absence_ linux version perl in the dir /compat/linux/usr/bin/
#
# $FreeBSD$
#
@NARGV=('-n');
$type=0;
foreach (@ARGV) {
    exit if $_ eq '-n'; # Aargh it's me again, exit immediatly
    next if $_ eq '-P';
    $type=1,next if $_ eq '-T';
    push @NARGV, $_;
}

$line = 0;

open(DF,"-|") or exec '/bin/df', @NARGV;
while(<DF>) {
   
   unless ($type) { print $_; next;}
   @cols = split();
   if ($line++) {
    $col = 'ext2fs';
   } else {
    $col = 'Type';
   }
   @cols = (@cols[0], $col, @cols[1..$#cols]);
   print join("\t", @cols),"\n";
}