Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: edit.sh

Issue 29761555: #8852 - ldap sync output filter (Closed)
Patch Set: #8852 - ldap sync output filter Created May 15, 2018, 8:59 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | output.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/sh
2 #####################################################################
3 #####################################################################
4 ## The cause of this script is to make the output of the LDAP ##
5 ## sync cron job more readable by filtering all repeated lines ##
6 #####################################################################
7 #####################################################################
8
9 last_updated=""
10
11 while IFS= read -r line; do
12 if echo "$line" | grep -q "Updating" ||
13 echo "$line" | grep -q "Creating"
14 then
15 last_updated="$line"
16 fi
17
18 if echo "$line" | grep -q -v "Updating" &&
19 echo "$line" | grep -q -v "Creating" &&
20 echo "$line" | grep -q -v "Found" &&
21 echo "$line" | grep -q -v "#" &&
22 echo "$line" | grep -q -v "Synchronizing" &&
23 echo "$line" | grep -q -v -F -e "->"
24 then
25 echo $line
26 fi
27
28 if echo "$line" | grep -q -F -e "->"
29 then
30 echo $last_updated
31 echo $line
32 fi
33 done
OLDNEW
« no previous file with comments | « no previous file | output.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld