[Gllug] Script for splitting dirs

Tethys tet at accucard.com
Tue Jun 3 14:22:32 UTC 2003


"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

Tet


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




More information about the GLLUG mailing list