#!/bin/bash # parses project.gitref project= gitref=project.gitref while read line do if [[ $line =~ \[([_a-z]*)\] ]] then project=${BASH_REMATCH[1]} elif [[ $line =~ remote.origin.url=(.*) ]] then remote_origin_url=${BASH_REMATCH[1]} echo "$project $remote_origin_url" case $project in sharedrawweb) sharedrawweb_remote_origin_url=$remote_origin_url ;; artloglaby) artloglaby_remote_origin_url=$remote_origin_url ;; *) echo "ERROR unrecognized project='$project' line='$line'" ;; esac fi done <$gitref