Skip to content

Instantly share code, notes, and snippets.

@satiridev
Last active December 23, 2020 04:36
Show Gist options
  • Save satiridev/c07d406023480d1b875328cd4b45cdbd to your computer and use it in GitHub Desktop.
Save satiridev/c07d406023480d1b875328cd4b45cdbd to your computer and use it in GitHub Desktop.
#!/bin/bash
# -F',' will split by comma
# BEGIN{RS="\r\n"} will remove \r\n (crlf) from the end of the string
# {print $3} will take the 3rd column and pass it to the next command
# -G option will read the data-urlencode
cat some.csv | awk -F',' 'BEGIN{RS="\r\n"}{print $3}' | while read x; do curl -v -G --data-urlencode "email=$x" \
-X POST "https://path/to/the/host" \
-H "accept: */*" \
-H "Authorization: Bearer some-jwt-string-for-authorization"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment