summaryrefslogtreecommitdiff
path: root/postpost/del_headings
blob: 0dc4182b8143a228f642641a87334cbb89106cad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

for t in $1*
do
  if [ -e $t ]
  then
    for u in $t"/Post/*_noheadings"
    do
      if [ -e $u ]
      then
        rm $u;
      fi
    done
  fi
done

for t in $1*
do
  if [ -e $t ]
  then
    for s in $t/Post/ft-*
    do
      if [ -e $s ]
      then
        echo $s;
        u=$(grep -c . $s);
        u=$[$u-1];
        tail -n$u $s > $s"_noheadings";
      fi
    done
  fi
done