Question: I need to convert the following command : cat/home/seed/DEsktop/index | while read output do host $output | grep has address | cut -d -f4 done

I need to convert the following command :

cat/home/seed/DEsktop/index | while read output

do

host "$output" | grep "has address" | cut -d -f4

done

TO:

Bash allows for online programming code such as for each type loops in the form: for in ; do ; done for example:

for var1 in $(cat mylist);

do wc $var1;

done

would give you a word count of each file list in the file called mylist. (the $ indicates a variable vice text)

I need the for loop to have the same outcome as the following, providing an IP address:

I need to convert the following command : cat/home/seed/DEsktop/index | while read

Thank you so much!

P ubuntu16.04 Running] - Oracle VM VirtualBox File Machine View Input Devices Help Terminal t E) 5:15 AM ip.sh (~/Desktop)-gedit Terminal [09/16/18]seed@VM:/Desktop$ ./ip.sh > new [09/16/18]seed@VM:~/Desktop$ cat new 208.74.205.244 23.9.242.146 172.217.166.174 [09/16/18] seed@VM:/Desktop$ Open cat /home/seed/Desktop/index | while read output do host "output" I grep "has address "I cut -d""-f4 done shTab Width: 8 Ln 1, Col1 ^ a do)ENG 2:45 PM 16/09/20183

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!