Skip to content

Instantly share code, notes, and snippets.

View dkhill's full-sized avatar

David K Hill dkhill

  • Far West Computer Consulting
  • Denver, Colorado, USA
  • 16:19 (UTC -06:00)
View GitHub Profile
@L04DB4L4NC3R
L04DB4L4NC3R / treemd.sh
Created July 7, 2020 18:08
Tree command output to markdown
#!/bin/bash
#File: tree-md
tree=$(tree -tf --noreport -I '*~' --charset ascii $1 |
sed -e 's/| \+/ /g' -e 's/[|`]-\+/ */g' -e 's:\(* \)\(\(.*/\)\([^/]\+\)\):\1[\4](\2):g')
printf "# Project tree\n\n${tree}"