#!/bin/bash clear # Push everything to Gitea... echo -e '\e[1;33mPush everything to Gitea...\e[0m'; echo ''; function updateGit { local -n arr=$1 for i in "${arr[@]}" do # Update the remote git repo... echo -e '\e[1;36mUpdate the remote' $i 'git repo...\e[0m' cd /foo/$i/ git add . git commit -m 'Modified' .; git push -u origin main; # Done echo -e '\e[1;36m'$i 'done\e[0m' echo '' done } # Define the array of all the directory names array=( "Arduino" "Calckey" ) # Loop updateGit array # Everything done echo -e '\e[1;33mEverything done\e[0m';