| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |