Skip to content

Instantly share code, notes, and snippets.

@manishmore
Created January 28, 2020 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manishmore/d55961bcf3f0078c3c13b46765186678 to your computer and use it in GitHub Desktop.
Save manishmore/d55961bcf3f0078c3c13b46765186678 to your computer and use it in GitHub Desktop.
Build-jenkins-job-loop.txt
for i in *.txt; do
if [ -s "$i" ]
then
echo "$i has some data."
while read p; do
for j in $(echo $p | sed "s/,/ /g")
do
# call your procedure/other scripts here below
echo "$j"
done
echo "$p"
done <$i
echo "$i"
curl -I POST "http://localhost:8090/job/MacOS/buildWithParameters?token=Manish&param1=$i"
[ -f "$i" ] || break
# do something as file has data
else
echo "$i is empty."
# do something as file is empty
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment