Skip to content

Instantly share code, notes, and snippets.

@mping
Last active October 9, 2017 13: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 mping/351755b876939ba80a4e26f1927bd3c4 to your computer and use it in GitHub Desktop.
Save mping/351755b876939ba80a4e26f1927bd3c4 to your computer and use it in GitHub Desktop.
Multiline processing with bash
#!/bin/bash
## run nc with
# while true ; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l 1500; done
#curl -XPOST -H "Partner-Id:230" --data "@-" http://localhost:1500
while read email; do
curl -X POST -d "$email" http://localhost:1500;
done << EOF
param=xxx
param=yyy
EOF
#echo "$emails" | curl -XPOST -H "Partner-Id:230" --data "@-" http://localhost:1500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment