X-Git-Url: http://pileus.org/git/?p=vpaste;a=blobdiff_plain;f=index.cgi;h=e311a94d62da46c87cedd9c14818d20656fde426;hp=f3a4a7e76f11921aaa61c96a893a54b734fa0cd8;hb=aeb74290389cee356e958f94e14d429777e274ac;hpb=1e266b439c4550432abc1c20512f6edf2786c88e diff --git a/index.cgi b/index.cgi index f3a4a7e..e311a94 100755 --- a/index.cgi +++ b/index.cgi @@ -71,14 +71,14 @@ function do_cmd { header text/plain case "$1" in head) - awk ' - BEGIN { rows=4; cols=60; } + awk -v 'rows=4' -v 'cols=60' ' FNR==1 { gsub(/.*\//, "", FILENAME); print FILENAME print "-----" } FNR==1,/^$/ { next } /\S/ { i++; printf "%."cols"s\n", $0 } - i>=rows { i=0; print ""; nextfile } + i>=rows { nextfile } + ENDFILE { i=0; print "" } ' $(ls -t db/*) ;; ls)