summaryrefslogtreecommitdiff
path: root/http/bin/cut_longlog_meta
blob: 914f455f807968c59dfaaa14d85095f797f1b60c (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
34
#!/bin/sh -e

meta=""
read_published_on=0
while read line
do
  meta="${meta}
${line}"
  if [ "$(echo "$line" | cut -c1-14)" = "Published on: " ]
  then
    read_published_on=1
    break
  fi
done

if [ "$read_published_on" -eq 0 ]
then
  echo "$meta"
  exit 0
fi

read line
if [ "$(echo "$line" | cut -c1-14)" = "Updated: " ]
then
  meta="${meta}
${line}"
else
  echo "$line"
fi

while read line
do
  echo "$line"
done