#!/bin/sh # create list with the first 7 lines of all scripts in markdown # author: @fabiantheblind # the headlines are formated to point to github raw files # # # #touch overview.md if [ -e "overview.md" ]; then echo "\"overview.md\" already exists. I will remove it" rm overview.md fi numfiles=(*) numfiles=${#numfiles[@]} echo "There are $numfiles .jsx / .txt / .sh files in this directory" #echo ls -l | grep -c "^-.*" echo "##Autogenerated Overview " >> overview.md; for file in *.{jsx,json,txt,sh}; do if [ -e "$file" ]; then echo "###[${file}](https://raw.github.com/fabiantheblind/auto-typo-adbe-id/master/fabiantheblind/${file}) " >> overview.md; #echo " \n" >> overview.md; head -7 "${file}" >> overview.md; #echo " \n" >> overview.md; echo " \\n-------------- \\n " >> overview.md; fi done open overview.md