From the course: Cisco DevNet Associate (200-901) Cert Prep 5: Infrastructure and Automation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Bash script automation example

Bash script automation example

From the course: Cisco DevNet Associate (200-901) Cert Prep 5: Infrastructure and Automation

Start my 1-month free trial

Bash script automation example

- [Instructor] Of course, network animation doesn't always need to be complicated or involve controllers or different frameworks. We can really do a lot with simple Linux commands and bash shells, for example. As network engineers, something that we've done many times is the ping operation. We could automate the ping test with simple bash script with a loop. For example, if I just go ahead and create this new file called reach test dot SH and what I'll do is, I will just say bin bash and I will go ahead and assign a variable for a sequence of 120 to 125 using a back tick and I'll say do and ping with a count of one and I will go ahead and ping various hosts on my local network, and I can use the dollar sign of IP to signify substituting the IP for the variable between 120 to 125. And that's it, so now I just need to execute that and look at the results so I know 120 doesn't really have anything, 121 doesn't have…

Contents