Last active
December 23, 2020 04:36
-
-
Save satiridev/c07d406023480d1b875328cd4b45cdbd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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