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

Unified Diff: edit.sh

Issue 29761555: #8852 - ldap sync output filter (Closed)
Patch Set: Created April 25, 2018, 11:42 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: edit.sh
diff --git a/edit.sh b/edit.sh
new file mode 100755
index 0000000000000000000000000000000000000000..3a7bf460083cd0d891307fe9df51ce970ee24126
--- /dev/null
+++ b/edit.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
f.lopez 2018/05/04 01:50:54 please use /bin/sh instead of /bin/bash This way
+
f.lopez 2018/05/04 01:50:54 What is this script about? What is the intention o
+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)
+
+for (( i=0; i < ${#lines[*]}; i++ ))
f.lopez 2018/05/04 01:50:54 and while you are looking into the comment above,
+do
+ 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
+ echo ${lines[$i]}
+ elif [[ ${lines[$i]} == *"Updating"* ]] && [[ ${lines[$i+1]} == *"->"* ]]; then
+ echo ${lines[$i]}
+ fi
+done
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld