1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00
freebsd-ports/emulators/vmware2/files/df
Josef Karthauser 6f08968435 Virgin import of Vladimir N. Silyaev's port of the linux version of the
VMWare virtual machine.

PR:		ports/16337
Submitted by:	vsilyaev@mindspring.com
2000-01-26 22:06:13 +00:00

29 lines
616 B
Perl

#!/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/
@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";
}