Hello, this is my first time ever using bash scripting for web . I have the foll
ID: 3748255 • Letter: H
Question
Hello, this is my first time ever using bash scripting for web. I have the following task. I initially retrieved web from www.cisco.com by using wget. Then I used the command line to clean it up to where I only have the websites to convert to IP addresses.
My first question; did I clean this up enough to perform the following tasks in the instruction I provided below. If not, how do I clean it up?
Second: How do I do the task asked after below.?
Thank you so much.
TASK:
text.txt cleanred up from www.cisco.com using wget and linux commands:
Now we have a clean list of domain names, so the next step is convert them to IP addresses Host command host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa, (man the host command for details) Bash allows for online programming code such as for each type loops in the form: for in ; do ; done for example: for. varl in S(cat mylist), de wc Svar1; done would give you a word count of each file list in the file called mylist. (the S indicates a variable vice text) Use a bash for loop to convert the host name to an ip addresses (save as lab3-7.txt)Explanation / Answer
Hi,
First of all congratulations for getting into the world of bash scripting.
Part 1. Did I do the cleanup right way?
I think no. Domain names have an IP address. A webpage residing on a server don't. So instead of `www.cisco.com/c/en/us/about/help.html`, you should try to clean up 'cisco,com'
Once you have that file, you can use `host domain name` and do a grep for ip pattern.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.