#!/bin/bash # # linktree -- 2008-09-15 # # Make a link tree for the current directory, creates linktree.html # for inclusion in index.html with this SSI directive: # # # # Linktree lines are padded with " " (two blanks) and include the #
formatting tags. # # Copyright (C) 2008 Grant Coady " $1
next
}
!/^ / && /^.-- / {
printf " %s %s\n", $1, $2, $2
dir = $2
next
}
{
link = sprintf("%s", dir, $NF, $NF)
}
!/^ / && /^| .-- / {
print " " $1, " " $2, link
}
/^ .-- / {
print " ", $1, link
}
END {
print ""
}
' > linktree.text
# end