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: Created April 25, 2018, 11:42 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 | no next file » | 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/bash
f.lopez 2018/05/04 01:50:54 please use /bin/sh instead of /bin/bash This way
2
f.lopez 2018/05/04 01:50:54 What is this script about? What is the intention o
3 IFS=$'\n' lines=($(cat /dev/stdin))
f.lopez 2018/05/04 01:50:54 you may want to look into doing this with `read(2)
4
5 for (( i=0; i < ${#lines[*]}; i++ ))
f.lopez 2018/05/04 01:50:54 and while you are looking into the comment above,
6 do
7 if [[ ${lines[$i]} != *"Updating"* ]] && [[ ${lines[$i]} != *"Found"* ]] && [[ ${lines[$i]} != *"Synchronizing"* ]] && [[ ${lines[$i]} != "#"* ]]; then
f.lopez 2018/05/04 01:50:54 the double square brackets (`[[`) is a bash featur
8 echo ${lines[$i]}
9 elif [[ ${lines[$i]} == *"Updating"* ]] && [[ ${lines[$i+1]} == *"->"* ]]; the n
10 echo ${lines[$i]}
11 fi
12 done
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld