Hi ,
Don't use plagiarized sources. Get Your Custom Essay on
Bash Scripting: I have the following website; wget www.pensacolachamber.com that…
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT!
Assuming that the question is to translate the domain name to IP address using bash script, I have prepared the answer.
Please follow the below three methods for reducing resolving the www.pensacolachamber.com to IP address.
Method 1:
Using wget command –
wget www.pensacolachamber.com > ip_address.log 2>&1 ; cat ip_address.log | grep ‘Resolving’ | grep -oE “b([0-9]{1,3}.?){4}b”
Please execute the above command the get the IP address of the www.pensacolachamber.com domain.
Method 2:
Using ping command-
ping www.google.com -n 1 | grep ‘Ping statistics’ | grep -oE “b([0-9]{1,3}.?){4}b”
Please execute the above command the get the IP address of the www.pensacolachamber.com domain.
Method 3:
Using dig command – This will work only if dig package is installed in the client machine.
dig www.pensacolachamber.com +short | grep -Ev ‘[a-zA-Z]’
Please execute the above command the get the IP address of the www.pensacolachamber.com domain.
Making the commands as script:
This is goinf to straight forward. Choose your favorite test editor and copy paste the commands from any one of the methods into the script file and save it as hostname_to_ip.sh
Now execute the below commands (make sure you reside in the same directory)
chmod o+x hostname_to_ip.sh
bash hostname_to_ip.sh
Thats it.. This should solve your question.. Thanks !! Have a great day 🙂