linux shell脚本遍历文件夹把md转成html
=======================================================
vi ./test.sh
#!/bin/bash function show() { cd $1 for i in `ls` do if [ -d "$i" ] then show "$1/$i" else filename=$(basename "$1/$i") extension="${filename##*.}" filename1="${filename%.*}" if [ "$extension" = "md" ] then eval "python -m markdown.__main__ $1/$filename1.md > $1/$filename1.html" fi fi done cd .. } show $1 exit 0