It doesn't seem like sed is aware of the $IP variable. How can I get the following to work?
read -p "Please enter the line number with the IP you wish to block from accessing the Internet? " IP
echo $IP
IP_LINE_NUMBER=`nmap -n -sn 192.168.3.0/24 -oG - | awk '/Up$/{print $2}' | sed '$IPq;d'`
echo $IP_LINE_NUMBER