Skip to content

Instantly share code, notes, and snippets.

@oscar-c
Last active April 2, 2019 04:56
Show Gist options
  • Save oscar-c/637998af472825d1c4c57739ad5506f4 to your computer and use it in GitHub Desktop.
Save oscar-c/637998af472825d1c4c57739ad5506f4 to your computer and use it in GitHub Desktop.
#!/bin/bash
input="ip"
unset transcribing
begin_pattern="[red]"
end_pattern=""
while read -r var
do
if [[ -v transcribing ]] ; then
if [ "$var" == "$end_pattern" ] ; then
exit
fi
echo $var
else
if [ "$var" == "$begin_pattern" ] ; then
transcribing=1
fi
fi
done < "$input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment