Przygotowałem skrypt, który przeszukuje katalog ~/src i wykonuje kopię zapasową plików kompiluj.sh oraz adres url repozytorium. Całość ląduje w katalogu ~/src/src-repozytoria.

#!/bin/bash

cd ~/src

test -d src-repozytoria || mkdir src-repozytoria

for dir in $(ls -d */); do
    cd $dir
    if [ -f ./kompiluj.sh ]; then
        test -d ~/src/src-repozytoria/$dir || mkdir ~/src/src-repozytoria/$dir
        cat ./kompiluj.sh > ~/src/src-repozytoria/$dir/kompiluj.sh
    fi
    if [ -f .git/config ]; then
        test -d ~/src/src-repozytoria/$dir || mkdir ~/src/src-repozytoria/$dir
        URL=$(grep url .git/config | awk '{ print $3 }')
        echo $URL > ~/src/src-repozytoria/$dir/url.txt
    fi
    cd ..
done

wstecz

Date: 2020-10-22T01:22:38+02:00