I have script which reads from method
file :
OPTIONS
and checks whether the OPTIONS
is allowed on a particular site. The script is :
#!/bin/bash
#
#
if [ ! $# == 1 ]
then
echo "Usage: $0 [ URL ]"
exit 1
fi
cat method | while read LINE
do
cat << __eof > header
$LINE / HTTP/1.1
Host:$1
__eof
nc $1 80 < header
done
So I can run this test against google.com and other sites. But when I run against localhost:8080
I get an error :
nc: getaddrinfo: Name or service not known
I'm very new to scripting. Can anyone help me out?