if [ "$#" -lt "1" ];then echo "Input Error" exit fi
i=0 j=0 for argv in $* do # echo $argv if [ $argv = "-t" ];then CurState="Tags" IsParam="true" elif [ $argv = "-c" ];then CurState="Category" IsParam="true" else IsParam="false" fi
if [ $IsParam = "false" ];then if [ $CurState = "Tags" ];then let i++ Tags="$Tags $argv" elif [ $CurState = "Category" ];then let j++ Category="$Category $argv" else Title="$Title $argv" fi fi done
#echo "Tags=$Tags" #echo "Category=$Category" #echo "Title=$Title" #echo "CurDate=$Date" for path in $Category do if test -d "$PostPath$path" ; then PostPath="$PostPath$path/" continue else mkdir $PostPath$path PostPath="$PostPath$path/" fi done for CurFile in $Title do
cd $PostPath mkdir $CurFile CurTitle=$CurFile CurFile="$CurFile.md" if [ $j = "1" ];then Category=`echo "$Category" |sed -n "s/^[ ]*//gp"` else Category=`echo "$Category" |sed -n "s/^[ ]*//gp"|sed -n "s/ /,/gp"` fi