Skip to content

Instantly share code, notes, and snippets.

@knight76
Created August 1, 2019 11:19
Show Gist options
  • Save knight76/e9442e9257c1539e1717eaa2d5495889 to your computer and use it in GitHub Desktop.
Save knight76/e9442e9257c1539e1717eaa2d5495889 to your computer and use it in GitHub Desktop.
# read file and apply foreach.
# example - (curl )
for i in $(cat file); do
curl -X GET "http://localhost/api/v1/orders/$i" -H "accept: application/json;charset=UTF-8"
sleep 1
done
# example - (getting ip from ping)
for i in $(cat hosts); do
ping -c1 $i | grep bytes | grep PING | awk {'print $2 substr($3, 1, length($3)-1)'}
sleep 1
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment