www.pokeroconnor.com


curl for response code

February11

This is handy, you can use:

curl -w %{http_code} url

to retrieve the http response code for a given url.

Bash script for parsing my lotto results:

#!/bin/bash

count=0;
var1=0;

exec<"lotto.txt"

while read line

do

if [ $[$count % 2] -eq "0" ];
then
var1=$(echo $line | awk '{ print $1 $2 $3}');
echo $line;
else
var2=$(echo $line[-1] | awk '{ print $1 $2 $3}');
echo $var1 $line;
#echo $date1
fi
let "count+=1";

done

//
posted under php
2 Comments to

“curl for response code”

  1. On April 3rd, 2009 at 10:12 am Luke Dutton Says:

    That code is A1 – Shamoan!

  2. On September 14th, 2009 at 2:02 am Brian Egge Says:

    Thanks for the post. I’m using the output to assign the return code to a variable. Works great.

    code=$(curl -so/dev/null -w %{http_code} $url)

Email will not be published

Website example

Your Comment: