Skip to content

Commit 7835c17

Browse files
committed
fix
1 parent 5a9d9f0 commit 7835c17

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

class/del_tag.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 给文件贴标签
1+
# 删除源文件标签
22
# 注意, 不要修改归档目录中的归档md的文件名, 因为要用它
33

44
# 1. fixpath , 修正*.md中的file路径
@@ -9,13 +9,12 @@ for file in `ls [0-9]*.md`
99
do
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 删除标记"

class/ins_tag.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ do
5555
done
5656
done
5757

58-
# 4. 排序
58+
# 4. 排序, 去重
5959
for file in `ls [0-9]*.md`
6060
do
61-
cat $file | sort -k 2 -n > ./sort.tmp
61+
cat $file | sort -k 2 -n | uniq > ./sort.tmp
6262
cat ./sort.tmp > ./$file
6363
done

0 commit comments

Comments
 (0)