| 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 |