Reputation: 65476
I wrote this (brute force) script bring multiple repos up to date.
for app in $(/bin/ls -d $@)
do
cd $app
pwd
git pull
cd ..;
done
Is there a simpler way I can do this please?
Upvotes: 2
Views: 66
Reputation: 32938
You could at least simplify the script:
And to avoid bugs:
--
on cd
to avoid arguments being interpreted as optionscd
failsfor app; do
(
cd -- "$app" || continue
pwd
git pull
)
done
BTW Shellchek is a great resource for debugging shell scripts. I got most of these tips there.
Upvotes: 4