File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,20 @@ COUNT=0
36
36
TAB=" $( echo -e " \t" ) "
37
37
38
38
# Convert newlines to HTML breaks.
39
- MESSAGE=" ${MESSAGE// \\ n/ <br>} "
39
+ MESSAGE=" $( echo -n " ${MESSAGE} " |
40
+ awk ' BEGIN { l=0; } { if (++l > 1) printf("<br>"); printf("%s", $0); }' ) "
41
+ MESSAGE=" ${MESSAGE// / } "
42
+
40
43
# Messages may have "/" in them so we can't use that to search in sed,
41
44
# so use "%" instead, but because it could be in a message (although unlikely),
42
45
# convert all "%" to the ASCII code.
43
- MESSAGE=" ${MESSAGE//%/ &# 37;} "
46
+ # The pound sign in escaped only to make gvim look nicer.
47
+ MESSAGE=" ${MESSAGE//%/ &\# 37;} "
44
48
45
49
# If ${MESSAGE} contains "*" it hoses up the grep and sed regular expression, so escape it.
46
50
ESCAPED_MESSAGE=" ${MESSAGE// \* / \\ * } "
47
51
52
+
48
53
if [[ -f ${ALLSKY_MESSAGES} ]] && M=" $( grep " ${TAB}${ESCAPED_MESSAGE} $" " ${ALLSKY_MESSAGES} " ) " ; then
49
54
# tail -1 in case file is corrupt and has more than one line we want.
50
55
PRIOR_COUNT=$( echo -e " ${M} " | cut -f3 -d" ${TAB} " | tail -1)
You can’t perform that action at this time.
0 commit comments