Skip to content

Instantly share code, notes, and snippets.

@stronk7
Last active June 7, 2016 16:47
Show Gist options
  • Save stronk7/fd7c4ec94cbce29fecc91a91e666e1c5 to your computer and use it in GitHub Desktop.
Save stronk7/fd7c4ec94cbce29fecc91a91e666e1c5 to your computer and use it in GitHub Desktop.
#!/bin/bash
while read -r line; do
echo Processing: $line
if [[ ${line} =~ ^\"MDL-[0-9]*\",\"(.*)\" ]]; then
versions=${BASH_REMATCH[1]}
echo Versions: ${versions}
IFS=',' read -ra versionsarr <<< "$versions"
for version in "${versionsarr[@]}"; do
echo $version
done
fi
echo
done < <(echo '"MDL-54820","3.1.1"
"MDL-54805","3.0.5,3.1.1"
"MDL-54769","3.0.5,3.1.1"
"MDL-54765","3.0.5,3.1.1"
"MDL-54739","3.1.1"
"MDL-54729","3.1.1"
"MDL-54702","3.1.1"
"MDL-54557","3.0.5,3.1.1"
"MDL-54180","3.0.5,3.1.1"
"MDL-53947",""
"MDL-53392","3.0.5,3.1.1"
"MDL-50824","3.0.5,3.1.1"
"MDL-49852","3.0.5,3.1.1"
"MDL-48756","3.0.5,3.1.1"
"MDL-46721","3.0.5,3.1.1"
"MDL-41922","3.0.5,3.1.1"
"MDL-35104","STABLE backlog"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment