All pastes #262449 Raw Edit

Bugger

public text v1 · immutable
#262449 ·published 2006-11-30 15:17 UTC
rendered paste body
#!/bin/csh -f


if $#argv != 2 then
        echo Usage: $0 Filename_Size Directory
else
        find * -prune -type f > filenames.txt
endif

set SIZE = `wc -l filenames.txt`
@i=1

while ( i <= SIZE ) then
        set line = head -$i filenames.txt | tail -1 | wc -c
        if ( $line <= argv[1] ) then
                head -$i filenames.txt | tail -1 | xargs rm
                @i=i+1
        else
                @i=i+1
end