[Gllug] Script for splitting dirs

Andy Farnsworth farnsaw at stonedoor.com
Tue Jun 3 14:04:15 UTC 2003


> "Daniel Andersson" writes:
>
> >> Not really. The only issue is getting the filesize, which is either
> >> done by parsing the output of ls, or calling a helper application.
> >
> >haven't really followed this
> >but what about using "filesize", no need to parse output of ls
>
> That would count as a helper application. Plus:
>
> 	isengard:~% filesize
> 	bash: filesize: command not found
>
> I'm guessing it's a Debian thing. It makes your script non-portable
> even to different Linux distributions, let alone to other Unices.

I doesn't seem to be a Debian thing either.  I run Debian and it is not
available via apt-get / dselect at all.

However, here i a perl oneliner that returns the filesize of the filename
passed to it.

#!/usr/bin/perl -l
print ((stat $ARGV[0])[7]);

Andy Farnsworth



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list