Created
May 19, 2021 01:47
-
-
Save ocommaj/f7ffdfc5cd1d7adb64c7b71f23f70e07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
find_me="Process image" | |
results=() | |
next_idx=0 | |
while read -r LineFromFile || [[ -n "${LineFromFile}" ]]; do | |
if [[ $LineFromFile =~ "$find_me" ]]; then | |
results[$next_idx]=$LineFromFile | |
next_idx=$((next_idx+1)) | |
fi | |
done<"$1" | |
for line in "${results[@]}"; do | |
echo "$line" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment