Skip to content

Instantly share code, notes, and snippets.

@xbalaji
Last active October 10, 2022 04:02
Show Gist options
  • Save xbalaji/67eb9cf3e6d231d3a8ab8f5145adccba to your computer and use it in GitHub Desktop.
Save xbalaji/67eb9cf3e6d231d3a8ab8f5145adccba to your computer and use it in GitHub Desktop.
generate a quick index.html page including sub directories
# oneliners-generate-index-html.sh
# this takes care of sub directories as well, adds a table with row numbers, easy for reference
# wrote this script for generating pages in gitlab :)
find . -type f | sort | awk 'BEGIN {print "<html><body><table align=center border=1>"} {printf "<tr><td>%d<td><a href=\"%s\">%s</a>\n", FNR, $0, $0 } END {print "</table></body></html>"}' > index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment