Skip to content

Instantly share code, notes, and snippets.

@mmodrow
Created April 8, 2019 14:38
Show Gist options
  • Save mmodrow/c482827f7f090193f795ee99137b875b to your computer and use it in GitHub Desktop.
Save mmodrow/c482827f7f090193f795ee99137b875b to your computer and use it in GitHub Desktop.
Determines the HTTP StatusCode for every given url and prints it tab-separated with the url (to pipe into a CSV or Excel-File)
#!/bin/bash
for url in "$@"
do
statusCode=$(curl -i -s -L "$url" | grep HTTP/ | tail -1 | awk '{print $2}')
echo "$statusCode $url"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment