Plaster
New
List
Login
shell
default
gingerale
2017.06.20 10:07:46
#!/bin/bash BASEDIR="$(dirname -- "$(readlink -f -- "$0")")" # Replace "$0" with "$(pwd)" if you prefer DoUpdate () { NAME="$1" DIR="$2" cd $DIR if git pull > /dev/null 2>&1; then echo $NAME" SUCCESS!" else echo $NAME" FAILED!" fi } i=0 for d in $(ls); do DIR=$BASEDIR"/"$d if [ -d $DIR ]; then DoUpdate $d $DIR & PIDS[i]="$!" i=$((i+1)) fi done for pid in "${PIDS[@]}"; do wait $pid done
Raw
Annotate
Repaste