SuperHornet
12-07-2002, 06:34 PM
This script use's "find" to display the files path and filesize.
17201 winecheck
4096 xchat-xmms-0.7
6111 xchat-xmms-0.7/Artistic
2303 xchat-xmms-0.7/README
35349 xchat-xmms-0.7/xchat-xmms.pl
32 xchat-xmms-0.7/Xmms-Perl-0.12.tar.gz
119 xchat-xmms-0.7/DEADJOE
13322 xchat-xmms-0.7.tar.gz
what I am having trouble with, is stripping the filesize off and moving it into a array.
It always displays the size and file like it didnt do anything.
Maybe you can suggest something?
#!/usr/bin/perl -w
@search=`find * -printf %s" " -print`;
foreach $search (@search) {
$search =~ /([0-9])\b/;
push(@size , $search);
}
print @size;
17201 winecheck
4096 xchat-xmms-0.7
6111 xchat-xmms-0.7/Artistic
2303 xchat-xmms-0.7/README
35349 xchat-xmms-0.7/xchat-xmms.pl
32 xchat-xmms-0.7/Xmms-Perl-0.12.tar.gz
119 xchat-xmms-0.7/DEADJOE
13322 xchat-xmms-0.7.tar.gz
what I am having trouble with, is stripping the filesize off and moving it into a array.
It always displays the size and file like it didnt do anything.
Maybe you can suggest something?
#!/usr/bin/perl -w
@search=`find * -printf %s" " -print`;
foreach $search (@search) {
$search =~ /([0-9])\b/;
push(@size , $search);
}
print @size;