[Gllug] Script for splitting dirs

David Damerell damerell at chiark.greenend.org.uk
Tue Jun 3 15:47:02 UTC 2003


On Tuesday, 3 Jun 2003, Tethys wrote:
>"Daniel Andersson" writes:
>>daniel at cj:/usr/bin# more filesize
>>#!/bin/sh
>>#
>># Print the size of a file, in bytes.
>>#
>>echo -n "`ls -l $1 | tr -s ' ' | cut -f 5 -d ' '`"
>Oh. A perfect example of the perils of incorrect quoting:
>	isengard:~% filesize "filename with whitespace"
>	ls: filename: No such file or directory
>	ls: with: No such file or directory
>	ls: whitespace: No such file or directory

Also it's got to be easier to parse the output of "ls -s".

-- 
David Damerell <damerell at chiark.greenend.org.uk> flcl?


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




More information about the GLLUG mailing list