I am writing my first bash script. I am making it install all the repos I have on GitHub.
warpInLocations=("[email protected]:acc/toolkit.git" "[email protected]:acc/sms.git" "[email protected]:acc/boogle.git" "[email protected]:acc/cairo.git")
Those are them when I install them.
echo "warping in toolkit, sms, boogle and cairo"
for repo in "${warpInLocations[@]}"
do
warpInDir=$(echo ${warpToLocation}${repo} | cut -d'.' -f1)
if [ -d "$warpToLocation"]; then
echo "somethings in the way.. $warpInDir all ready exists"
else
git clone $repo $warpInDir
fi
done
This line here, I wanted it to give me a folder named toolkit
or sms
, so after the /
and before the .
in the warp in locations, but it's selecting git@github
instead. I guess, because it's after the .
.
How can I get it to select the name in the repo?
/
and the following.
?