File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1- # 给文件贴标签
1+ # 删除源文件标签
22# 注意, 不要修改归档目录中的归档md的文件名, 因为要用它
33
44# 1. fixpath , 修正*.md中的file路径
@@ -9,13 +9,12 @@ for file in `ls [0-9]*.md`
99do
1010 # TAG=归档文件名中的数字, 不要修改文件名
1111 TAG=` echo " $file " | awk -F ' .' ' {print $1}' `
12- # 查找是否已标记TAG
1312 for md in ` cat $file | grep " .md" | awk -F ' [' ' {print $1}' | awk ' {print "../"$2}' `
1413 do
1514 # 查找是否已标记TAG
1615 CNT=` head -n 10 $md | grep -c " ##### \[TAG" `
1716 if [ $CNT -eq 0 ]; then
18- # 未标记, 在第一行下面插入TAG
17+ # 未标记
1918 echo " $md $TAG 未标记"
2019 else
2120 echo " $md $TAG 删除标记"
Original file line number Diff line number Diff line change 5555 done
5656done
5757
58- # 4. 排序
58+ # 4. 排序, 去重
5959for file in ` ls [0-9]* .md`
6060do
61- cat $file | sort -k 2 -n > ./sort.tmp
61+ cat $file | sort -k 2 -n | uniq > ./sort.tmp
6262 cat ./sort.tmp > ./$file
6363done
You can’t perform that action at this time.
0 commit comments